View Realtime Requests Per Second From Log

so you want to view the number of requests to your webserver per second. here’s a quick and easy php script that you can run from command line.

while(true){
    echo exec('cat /var/log/httpd/access_log | wc -l') . "n";
    sleep(1);
  }

it isn’t perfect, but it will work for doing some basic troubleshooting. just hit ctrl+c to terminate.

and if you want to simulate a bunch of request so you can watch the num go up and down, here’s a script to help:

while(true) {
  exec('wget yourdomain.com');
  unlink('index.html');
}

Published byJosh McGinnis

Josh is a software engineer, leader, startup advisor for the LA Chamber of Commerce and consultant residing in the Los Angeles area. Josh is passionate about helping entrepreneurs and businesses reach their maximum potential.

No Comments

Post a Comment