Knowledgebase

Portal Home > Knowledgebase > Articles Database > 500 internal server error


500 internal server error




Posted by vigge_sWe, 06-02-2009, 04:29 PM
So, I have no ideas left now... I run a proxy. First, I was on shared hosting. Worked for 2 months. then, bam! 500 internal server error. I moved to a smaller VPS with 128 MB RAM. Worked for 30 min, then 500 internal server error again... So now I moved to a larger VPS with 512 MB RAM, 1 GB burstable. Worked for 2 days, and now the 500's is back... Rebooting the VPS usually fixes it, but I can not be sure I can continue rebooting it, as I expect it getting worse later. It usually starts with lighttpd goes insane. One minute it's using 30 mb RAM, ok that's good. Then suddenly it uses 300 mb. then 500 mb. Then the 500 internal server error occur. So any ideas of how I should configure this so it would work in a better way? This is filled in the error log: 2009-06-02 13:21:16: (mod_indexfile.c.182) file not found ... or so: Too many open files / -> /home/admin/datashelf.net/ OS: centOS 5

Posted by bigks, 06-02-2009, 04:30 PM
Most typical cause is out of resources. I have seen this more often on lighttpd than on apache and it's normal cause is poor mysql and lighttpd optimization. Can you wait until this error occurs then log into via ssh and post your top command results. Just a quick thought, when hard drives get loaded up by other users it can spur a high load average which does affect you.

Posted by The Universes, 06-02-2009, 04:34 PM
Are you on OpenVZ or Xen? If your on OpenVZ, please post your user_beancounters file, run this in SSH: My guess is your running out of memory (PHP fcgi?) or there is a misconfiguration somewhere.

Posted by vigge_sWe, 06-02-2009, 04:37 PM
openVZ I've switched to apache to check if it will work better, but I doubt it

Posted by bigks, 06-02-2009, 04:38 PM
If you are on lighttpd and switch to apache it will cause a high load on your vps making it unstable (granted we are assuming lighttpd was eating up too many resources as it was). Can you post your top command results?

Posted by The Universes, 06-02-2009, 04:47 PM
Your running out of memory and that is the most likely reason your getting those 500 errors:

Posted by vigge_sWe, 06-02-2009, 04:54 PM
but why would I run out of memory? I got 512 mb guaranteed, 1 gb burstable. So far with apache, so good. If apache wont work either, I'll try nginx again

Posted by bigks, 06-02-2009, 05:03 PM
Good luck man, you should pay attention to apache after around a day or so as you will see it leveling out on resources.

Posted by The Universes, 06-02-2009, 06:07 PM
Perhaps poor configuration, over provisioning of php-fcgi processes, or memory intensive scripts? Your UBC clearly shows that your VPS was out of memory some 500 times. As for 1GB burst, you can't always rely on that being available to you, you are guraenteed 512MB and its best to try and work within that as much as possible.

Posted by vigge_sWe, 06-02-2009, 06:22 PM
Yeh, but I have handled 2k pageviews/day on shared hosting before. But today I only got around 500, on a VPS. Why would it work better on shared hosting until 1&1 did something? Btw, anyone could give suggestion on how to configure correctly?

Posted by The Universes, 06-02-2009, 06:24 PM
Perhaps if you post your Lighttpd config we can take a look.

Posted by vigge_sWe, 06-02-2009, 06:38 PM
The kloxo default one. I'm going to bed as it's late and it's school tomorrow, so I wont be able to post it before tomorrow afternoon.

Posted by ldcdc, 06-02-2009, 07:13 PM
Maybe lighty has a memory leak. I recalled reading something about such, and here it is: http://hostingfu.com/article/nginx-v...or-a-small-vps I can't reach the page at this time, so here's a Google cache link just in case: http://74.125.77.132/search?q=cache:...ient=firefox-a So, try nginx and see if it's any better?

Posted by AppKoders, 06-02-2009, 08:48 PM
Usually shared hosting are hosted on high-end servers but on a VPS your resources are limited. I also encountered that error before and you can fix that by optimizing your config files if it did not work then I guess you should upgrade your plan.

Posted by The Universes, 06-03-2009, 12:23 AM
It probably did in the old days, but Lighttpd has come a long way since 2007 and thats no longer a problem.

Posted by DME-Geoff, 06-03-2009, 12:55 AM
The problem is with your 'privvmpages' limit. Your limit is 262144 while your VPS has bursted to 513017 thus leaving you out of resources. This is almost definately the cause of your 500 errors. You need to submit a ticket to your host asking them to increase your limit. EDIT: This is also related to your RAM and likely you really are running out of memory, this could be due to a poor configuration somewhere. See: http://wiki.openvz.org/Privvmpages#privvmpages Last edited by DME-Geoff; 06-03-2009 at 12:59 AM.

Posted by vigge_sWe, 06-03-2009, 02:22 AM
Yeh, but resources on a shared hosting is more limited. 1&1 only allows 64 mb ram, 6 seconds of 100% CPU usage and only 12 processes

Posted by bigks, 06-03-2009, 09:47 AM
vigge swer, the problem is that on shared hosting everything is optimized for top performance. Most people think when they buy a VPS and it's turned on that the VPS will/should perform without a problem. The reality is a VPS shares similarity's with a dedicated and must be optimizedto achieve top a good VPS. Just go to google and type in Mysql optimize my.cnf and how to optimize Apache or lighttpd.

Posted by vigge_sWe, 06-03-2009, 01:17 PM
That's the config I am using. What's wrong?

Posted by bigks, 06-03-2009, 01:26 PM
There are many guides available via a google search, have you done this yet?

Posted by The Universes, 06-03-2009, 01:56 PM
Can you check these two include files and find which one has the php-fcgi configs:

Posted by vigge_sWe, 06-03-2009, 02:13 PM
None of them has anything that mentions it. Also, I discovered that it goes insane at approx same time every day. Like it works for exactly 24 hours, then needs a reboot to work another 24 hours... idk, but may it be that I am getting DDoS'ed or something? Yesterday the network of my VPS was all the way up to 4 mbps...

Posted by bigks, 06-03-2009, 02:29 PM
Can you check logs to see when scavenge time is set to run? (if using lxadmin which I am guessing you are)

Posted by vigge_sWe, 06-03-2009, 02:48 PM
which log?

Posted by bigks, 06-03-2009, 03:10 PM
Perhaps you need to think about getting a managed solution.....if you are coming from a shared environment it is important for you to do your homework to not only protect your servers data but also to admin your virtual machine.

Posted by vigge_sWe, 06-03-2009, 03:11 PM
Yeh, but my budget is only $10/month, and I get 1k+ pageviews/day. So I can't afford managed.

Posted by gilbert, 06-03-2009, 03:41 PM
Create a custom php.ini file for the spefic website and put more strict limits on the max time to live and max memory usage per script etc. Also which proxy script are you using. Glype has settings were you can set it to not execute on loads over particular number.

Posted by vigge_sWe, 06-03-2009, 03:48 PM
Well, it seems like every visitor gets their own process, each using 20 mb. There are currently 45 php processes, using 20 mb each,with lxsuexec /home/admin/datashelf.net/browse.php as command. Also, I checked the stats of my proxy. pingomatic.com has got 700 visits in 3 days. Is there any reason or is it just popular?



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Problems with Outlook (Views: 584)
Windows Reseller (Views: 576)


Language:

Contact us