[SOLVED] Internal Server Error... Host says "too many concurrent processes"
accphotography
Joined: 2008-05-14
Posts: 66 |
Posted: Sat, 2012-03-31 02:48 |
Unfortunately I can't get into my gallery at all right now so I can't give much system information. I have just upgraded to the most recent G2 version though. The gallery is at: http://www.accphotography.com/gallery Lately when I've been uploading photos I've run into some issues with my gallery just crashing. Usually I give it a couple hours and it comes back with no problem. Last night I uploaded some photos, it went down and it never came back. I was getting a 500 Internal Server Error. I checked everything I could think of and found no problems. I contacted my host and was told: Quote:
Our servers have a limit of 50 processes which includes simultaneously running php and cgi scripts, as well as cron jobs and shell sessions. You are exceeding that. Why is this happening? It's not happening in any other area of my site, only Gallery. It had not ever happened before last night and now I can't get into the gallery at all because of it. Is it possible something is faulty within the gallery that is causing too many processes to run? Do I just have too many photos or too much activity and that is the cause? If this is something I can't get around, does anyone know of other hosts that allow larger limits? I would love to upgrade to G3 but I can't even get into the site to do anything at all. I can't even disable modules, etc. to attempt to free up processes. Right now I'm not getting the 500 error, I'm getting this error: Quote:
An error has occurred while interacting with the database. Can anyone help me with this? I am desperate. I have several major shoots I need to upload and clients are getting antsy. Thank you! Audrey |
|
Posts: 66
I just put it into debug mode (had to learn how to do that as I've never needed it before) and I'm not sure if you can see the results or not but here is what it gave me:
Posts: 1642
You say this issue had not happened before but didn't say when the host imposed this 50 process limit. Also is it 50 processes just for you or 50 processes for all such processes on the server across all accounts?
As to why it is not affecting other parts of your site, well these are semi-static pages (shtml - they should be purely static and use html but that's another issue) G2, and so will G3, run php scripts and need to access a database. That process is what your host is clamping down on. They appear to basically only want light websites, preferably only running static pages.
On the debug, you need the debug output that comes on the page (not the one from the smarty debug console). See here instead.
The output can be rather long so do not paste it directly in your post. Either put it in a text file and attach or use a paste bin and post a link. A popular paste bin is at pastebin.com.
However, I think that while we certainly could spend time trying to get to the bottom of this issue etc, if your host is shutting your processes down, and your site has commercial value, you should be looking at switching to a more capable setup. There is not likely to be any switch that can be flipped to make it your G2, and I'll wager, probably any other PHP application such as G3, work on your current server.
In summary, I am afraid it is time to change hosts. Go to webhostingtalk.com for recommendations.
--
dakanji.com
Posts: 66
Thank you VERY much for your reply!!
I'm attaching what I think you need as far as the debug. I hope that's the right one. It's not very long at all actually.
Ok. I see what you're saying, but I don't think that's actually the case here. Please understand I respect your knowledge and advice and I'm not trying to challenge you, I'm just seeing something odd I can't explain.
I was able to find a log file on my cPanel for the times that my site has exceeded the processes. Guess what? It has only ever happened in all my years with them about 5 times before Thursday night. Since Thursday night it has been happening non stop. There was a graph and a VERY obvious spike in Thursday night that has not dropped off. I went back and looked at the 5 or so prior times it happened... every single time I tried to upload photos. I was trying to upload photos when it went down Thursday night as well. Something is happening in the upload process that is locking things down. I've been struggling to upload the last several sessions for a few months now and usually am able to coax it to work with patience, but I can see why I always have trouble, it's topping out my processes. I also see why it normally resolves itself (when things are done, the processes go down, they restore the site). But now it's like it's locked into upload mode or something as the processes won't go down. Except for those 5 times and since Friday night I have NEVER exceeded 10 processes, now I am well over 50. Interestingly this all happened when I changed computers a few months back as I was unable to install the Windows Gallery Remote program and now have to use the Applet. It started when that happened.
So, somewhere there is a bug with my gallery and uploading, or the remote applet, or something. It's very clear by the logs this is a very recent change.
Any clues whatsoever what this could be? If I must I may have to uninstall G2 altogether and reinstall it if there's a bug in my code or something.
Thank you very, very much for your help!!
Posts: 1642
The pertinent error in that debug log is "1205: Lock wait timeout exceeded; try restarting transaction".
This is controlled by a MySQL parameter set by the host. In simple terms, it is how long the database will sit around in a locked state while waiting for a transaction to be completed.
Options are:
1. Change the G2 code to release locks frequently and to break up uploads into smaller batches. I believe it does them in batches of 100 or so but I am not sure and do not know if it releases locks and re-establishes them in between. There is an update effort on G2 going on and this will be looked into but will take some time if ever.
2. Open a support ticket with your host and ask them to increase the MySQL "TransactionDeadlockDetectionTimeout" setting. Long shot but worth a try.
3. Manually break up your uploads into smaller batches or use the zip upload facility.
The 50 process answer, which flat didn't make much sense, you got from your host is a typical support request response from certain types of hosts. Say anything to push the problem away.
--
dakanji.com
Posts: 66
Oh brilliant Dayo!! Thank you so very much!!!
Posts: 66
Hey Dayo! Apparently the server resets things when the month turns over as everything just suddenly freed up at midnight!! The gallery opens fully now.
Interestingly, the debug report got MUCH, much longer. I'm attaching it again. Can you tell me if there is anything of obvious/serious note here?
Thanks again!!
Posts: 1642
Yes. For some reason, this query "SELECT g_itemId FROM g2_FavouritesMap WHERE g_userId=6" is being run over and over and over again and similarly, the G2 core seems to be loading over and over and over again.
Seems almost like there is a runaway script and now my sympathy is with the host.
Do you have some sort of favourites module or something similar? I'll consider disabling it.
In your shoes, I'll go over the installation and remove all unnecessary modules.
--
dakanji.com
Posts: 66
Dayo, you're a genius. I uninstalled the module, ran a few maintenance tasks (that wouldn't even run before), deleted a few pics, uploaded a few pics and everything works PERFECTLY. I can't even begin to thank you enough. You rock!!!
Now I wonder why that module got corrupted. It worked for years. LOL
Thank you!!!! I'm sure my host thanks you very much as well!!!
Posts: 66
Oh another note, any idea why I get this when I try to run a rebuild resizes/thumbnails?
Thanks again!
Posts: 8339
Try my missing object fix.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2