Jump to content

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


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.

Edited by kicken
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.