Solved

Apache Issues

Posted on 2016-10-18
9
86 Views
Last Modified: 2016-10-24
Suppose you had a LAMP stack, and the Apache portion of this LAMP stack would work fine and serve a bunch of pages for a few days, but then it would randomly stop serving pages, and then when you tried to do a graceful Apache restart of this A portion of the LAMP stack, it wouldn't work, so you'd have to completely reboot the entire server to get it to work. Any idea on what is happening? We are using a apache2ctl restart command but it does not work so we have to reboot the server.

This is a SuSE Linux box.
0
Comment
Question by:CityInfoSys
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 7

Expert Comment

by:Jason
ID: 41848656
I have very little experience with suse in particular but is their anything in the log files that will help point you in the right direction and give you an idea of what is going wrong?
0
 
LVL 1

Author Comment

by:CityInfoSys
ID: 41848664
The log file makes no indication of what is causing the issue it is totally random.
0
 
LVL 26

Expert Comment

by:Dr. Klahn
ID: 41849314
Use apache2ctl stop and apache2ctl start instead.  This will break existing sessions and invalidate cookies, but it should always work.  Restart just tickles the running server.  

Check the memory usage on the system when the problem occurs and see if the system is page thrashing or using excessive pagefile.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 27

Expert Comment

by:skullnobrains
ID: 41849843
you'd need to debug when the problem occurs

post the output of "top" and "ps -auxww | grep httpd", try apachetop as well

try to kill the apache processes in other (more violent) ways such as "pkill httpd" or "pkill -9 httpd"

there are quite a few reasons why an apache process may become unresponsive... do you serve files over NFS ? do you have php processes that may last forever and clutter server threads ? is the machine properly responsive when apache dies ? which threading mechanism do you use ? mpm_prefork ?
0
 
LVL 1

Author Comment

by:CityInfoSys
ID: 41854515
On the latest crash Apache2ctl stop and start were successful in stopping and starting the processes, but I still couldn't access the website. Only a full off/on brought it back. Here are the outputs you requested from the most resent crashes.

Please scroll down it posted the photos differently.

ps -auxww | grep httpd
 1.pngps -auxww | grep httpd
2.pngTop
3.png
0
 
LVL 26

Expert Comment

by:Dr. Klahn
ID: 41854630
I do have to say I'm curious about how an Apache system is using up 5 GB of the available 8 GB of memory (according to top).  The processes shown on the top display account for around 2% of the 8 GB.
0
 
LVL 27

Expert Comment

by:skullnobrains
ID: 41854949
given the output of ps, it does not seem apache is the one using up 5Gb of ram ( unless i misread something )... a complete "ps -faux" or "pstree" might shed some light regarding what is actually using up the 5GB if necessary

... and there is apparently no resource shortage either ( cpu ok, ram ok ), no long wait for IOs ( waiting for a slow remote filesystem would produce a higher load average )...

my guess would be one of :
- either a script runs with no timeout and clutters all the available threads... looks unlikely and should be visible in the logs and/or apachetop or the likes so
- or apache is serving files from a mounted remote filesystem ( most likely NFS ) and the mount point broke
- if something like heartbeat is in use, network issues could arise as well and be solved by a reboot but you'd most likely have noticed a long time ago

when you reach a page when the problem is occuring
- does apache log the query ?
- does it actually answer with a blank page ? an error ? no answer at all ?

if there is no log and no answer, you might want to check there is no weird network issue : try the page locally with wget, or maybe with "apachectl status", or run "tcpdump -i any port 80" and check that your queries reach the server

if the queries do reach the server and unless one of the above information rings a bell, i'd probably go on running an strace on the apache processes while the problem is occuring and possibly sending a few queries manually while the strace is running so we know what apache is doing. if the httpd processes are locked, their status in top is an indication, and the current system call should be output by strace
0
 
LVL 27

Accepted Solution

by:
skullnobrains earned 500 total points
ID: 41854951
On the latest crash Apache2ctl stop and start were successful

just to make sure, did you actually check that the apache processes were dead after running "apache2ctl stop" ?

if the process were actually restarted, that would indicate a system problem such as a lost mount point, if no, that would direct us towards some lock in apache's internals or a script cluttering the available threads

---

you may also want to check for established connexion during downtimes
0
 
LVL 27

Expert Comment

by:skullnobrains
ID: 41857121
did you find what was wrong ?

if yes i'm interested, and others might be

if no you can accept your own solution for 0 points cost
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question