Quote:
Originally Posted by shivaa
|
You mean
pgrep apache2 or for sending a signal and allowing processes to close file descriptors:
Code:
pkill -15 apache2; sleep 10s; pkill -9 apache2
Quote:
Originally Posted by shivaa
You can close apache2 processes
|
Killing processes may alleviate the stress the system is under but without (pointing to performing) proper analysis it's like treating symptoms instead of addressing the root cause: not that effective.
Quote:
Originally Posted by Juc1
Or would the apache logs be more helpful?
|
Depending on how your machines specs (RAM and other bottlenecks), how access is regulated (like firewall request limiting), how your web server is configured (like stock with all unnecessary modules loaded), what it runs (any interpreter-based Off The Shelf application, homebrewn code, etc, etc) and their dependencies / configuration, web server configuration and access + error log files
should be the first things to check. You can also look at a current process with 'strace'. First select the Process Id:
and then
Code:
strace -o/path/to/strace.log -v [PID]
when you think you've got sufficient nfo kill the process with CTRL+C and then read "/path/to/strace.log" for clues.
*Also note that collecting system statistics over time, running any SAR like Atop, Dstat or Collectl, may give a better picture of what happens and when making it easier to search logs for clues.
Quote:
Originally Posted by Juc1
probably terminated because I restarted the VPS. So does a process get a consistent PID or might the PID vary from one day to another?
|
Restarting a service might help but restarting your VPS is quite drastic as you loose information that may help diagnosing the problem and it isn't how Linux should be handled. And PIDs are assigned sequentially BTW. With this:
Code:
\ps axfo pid,ppid,pgid,uid,cmd --sort=pid
you'll see all processes sorted by PID and this:
Code:
\ps -C apache2 fo pid,ppid,pgid,uid,cmd --sort=pid
confines your view to only Apache2 processes.