0

I run a server with centos, ispconfig, about 100 websites on it. It occasionally gets high load, but I have no real way to pinpoint whats causing this. I really want to see stats of hits/cpu usage per user/website (each site has its own user). This seems like it should be simple, I've tried many reporting packages including Munin, Goaccess etc but none of these give me what I need.

Any suggestions of software which can do this? Thanks.

anarki
  • 1
  • 2

1 Answers1

1

Check the location of your Apache log file, In my case i use C-Panel so my location is

/usr/local/apache/logs/access_log    --- full server logs
/home/user/access_logs/userdomain.com   --- logs for particular user.

Below commands will be useful for identifying cause of high load on Apache.

cat access_log| awk '{print $1}' | sort | uniq -c |sort -n

Generates a list of IP address preceded by the number of times it hit a site.

tail -10000 access_log| awk '{print $1}' | sort | uniq -c |sort -n

Generates a list that shows the last 10,000 hits to a site.

awk '{print $7}' access_log|cut -d? -f1|sort|uniq -c|sort -nk1|tail -n10

Generates a list of files or directories on your site being called the most.

for k in `ls -S /home/*/access_logs/*`; do wc -l $k | sort -r -n; done

Generates a list of all traffic for all domains (for multiple domains on a VPS or Dedicated server).

Modify as per your log file location...!!!

imvikasmunjal
  • 753
  • 7
  • 14