Jump to content

HELP! Where’s expert help for a random internal server error on my custom php, mysql, magento sites?


adam3000

Recommended Posts

We keep having random 500 Internal Server Errors on several of our PHP, MySQL, Magento based sites. I’ve spent hours trying to hunt down what’s happening.

 

Where can I find a php, mysql, magento expert to help me resolve this for good?

 

(Also, our host says our PHP-FPM process continues to segfault. If you know what that means.)

  • 4 weeks later...

segfault is when your script uses up more CPU than the server can deliver. In essence your script has so many calculations that the server can't handle the workload. In other words it CRASHes, hence the random 500 internal server errors. You get the 500 error when the script has too many calculations to execute and you don't get the error when the script doesn't have too many calculations to execute.

 

Let's say the server can handle a maximum of 10,000 rows, if the script fetches 10,001 rows or more it will crash and cause a 500 internal server error, if the script fetches 9,999 rows it will calculate it and serve the page just fine.

 

The only solution is to limit the number of calculations in the script.

 

For example: if you fetch 1 million rows from the sql database and then perform calculations on the fetched data, then the server will crash. The solution is to limit the number of rows fetched by let's say a 1000 rows.

segfault is when your script uses up more CPU than the server can deliver. In essence your script has so many calculations that the server can't handle the workload.

That is not at all correct. A SEGFAULT occurs when attempting to access an invalid memory location, such as trying to deference a null pointer.

In theory, PHP should never SEGFAULT because the interpreter should not allow such conditions to happen. In practice, it'll happen sometimes due to bugs, unstable builds, poor extensions, etc.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.