Something new for me 2 Sites one one server. Both pretty much the same script. Access the same database server (on same box). Both PHP / MySQL. One (the live one luckily) works just fine. The other one (dev site) is ocmpletely stuck. Loads for minutes but ends as 'document contains no data'. Checked the running processes and nothing is bogged down in terms of CPU or memory usage. Did a graceful restart of Apache which didn't solve anything either. I don't have a clue what it could be. I wasn't even editing any files, just managing some content via the site's back-end. They both use the same php executable so it's not likely to be PHP related, else the other site would have been down too, right? Can't be MySQL either, same story, other should be down too. Restarted Apache. What else can I do besides rebooting the whole machine? DNS / Virtual Host stuff seems OK too, and I didn't even touch it. Any ideas?
If they are using the same PHP files, are they referencing any other files (via include for example)? If so, try using the full file path to all the files you are referencing from within the PHP files.
No, they're in their own directories and even though on the same software (osC) they use their own individual files. Nothing is crossed/shared but the database host (but again, individual databases). Thing is, nothing changed. All worked fine 10 minutes ago, I;m just doing some stuff in back-end (filling in some forms) and gone it is, one site completely dead as in loading for ages. Just double checked and all files are still there, nothing is missing.
I'm no expert but compared to my homebox, my server's swap file seems excessive: Real memory: 1027256 kB total / 891032 kB free Swap space: 1052216 kB total / 1037608 kB free Like I said, CPU can handle things blindfolded: CPU load averages: 0.00 (1 mins) , 0.00 (5 mins) , 0.00 (15 mins) So how do I reboot the whole machine remotely? I googled and it seems like there are plenty of commands that do the same but all have like 10 different options... It's all a mystery to me!
A simple 'reboot' at the command line should be all you need to reboot, but to be perfectly honest I see no reason to do so yet. Run top, and hit 'm' to show the process that's hogging all the memory. Kill if the process if it seems like something non-critical or restart the daemon via the init script (eg /etc/init.d/apache restart). As a general rule a Linux/Unix box should *never* need to be restarted. Of course, there are exceptions to every rule, but this *probably* isn't one of them
I haven't done so yet. I did restart my own box here hoping the browser was whack but no luck. I did get into the back-end of my own dev site once but terribly slow. Still loading ages now. I checked running processes in webmin (which also loads just fine) but really, there is nothing out of the ordinary it seems. I now call the URLs in my browser and it loads the title and that's it. The rest stays blank forever and at the end of frever it says the 'The document contains no data'. Actually, saying that, it just loaded again but terribly slowly... What really doesn't make sense to me is the fact that the other site runs smoothly. If a graceful Apache restart doesn't help, is there a way (and is there any chance it would make a difference) to give Apache a proper reboot?
apachectl restart or apache2ctl restart (for apache2) will restart apache properly. Is there anything in the apache error log? it usually resides in /var/log/apache or /var/log/apache2, might be split up for your different virtualhosts, but else it's just called error_log or error.log.
Btw, as the other site loads fine, I do not think it's a resource problem, more likely it's a misconfiguration of something or a code error. Catch me on messenger if you want.
I haven't set up a proper log for this one yet so I'll have a look in the default. I looked at the running process on the command line as well but it's almost always 100% idle with occasional 'peaks' to 1% running. Just discovered that phpmyadmin also runs slow. It's on a 3d virtual host. So two seem pinned down, one is OK. I don't believe it's a code error. 1) I wasn2t coding and 2) both the front as well as back end of this one site do load now but very very slowly. And add to that that phpmyadmin is slow too (but faster than the dev site). I can try one more thing, that's killing the site's caching mechanism but to do that I'll have to get in the back-end somehow, which might take a while. If no luck I'll reboot the lot, Apache first. Thanks for helping out.
Strange. It's all gone back to normal and I haven't done anything yet. Did find an IP which isn't mine in the logs trying to access my phpmyadmin a couple of minutes before this started but it doesn't seem like trouble. Will investigate (and blocked it even though it's already password protected). Thanks for magically fixing it guys
For even more information run mysqladmin extended-status, there is a lot of good stuff there that can help trouble shoot mysql.