Results 1 to 2 of 2

Thread: How to calculate http connections peak per second

  1. #1
    adrian.gibanel.btactic is offline Senior Member
    Join Date
    Nov 2010
    Posts
    53
    Rep Power
    4

    Question How to calculate http connections peak per second

    According to Performance Tuning Guidelines for Large Deployments (HTTP) you should be able to calculate the number of http connections peak per second by taking a look at:

    access_log files (The ones found at /opt/zimbra/log/ I suppose).

    I suppose that it is a matter of a bash script with some of awk so that after taking out the day+hour I just leave the lines that have repeated hour+second string and just leave the ones that have more lines so that I get the peak by tunneling it to wc -l command.

    Is the algorithm idea right?

    Has anyone written this such a parser script? It would be nice if you could share it. Thank you.
    Adrian Gibanel, IT Manager

    "be free, be innovative, bTactic"

    Av. Balmes, 34 4rt 1a B | Lleida, Spain 25006

    www.btactic.com

  2. #2
    adrian.gibanel.btactic is offline Senior Member
    Join Date
    Nov 2010
    Posts
    53
    Rep Power
    4

    Post Awk script finished

    I have managed to code the script.

    I am having troubles creating wiki account (not Zimbra fault but mine). When I'm able to create it I will update the page's discussion so that someone hopefully includes the script in the official page.

    Here there is how you run the script:

    Code:
    cat access_log.2012-02-06 | awk -F ' ' '{print $4}' | awk -f access_log.awk
    .

    And here there is the access_log.awk file contents:
    Code:
    BEGIN {
        FS=":"
        Peak = 1
        CurrentPeak = 0
        oldVar=""
    
    }
    
    {
      #printf ("Linea: %s\n", $0)
      hour = $2
      minute = $3
      second = $4 
      #printf("hour: %s, minute: %s, second: %s\n",hour,minute,second)
      currentVar = hour minute second
      #printf ("currentVar definido: %s\n", currentVar)
      #printf ("oldVar definido: %s\n", oldVar)
      if ( currentVar == oldVar ) 
        {
          #printf ("1Current var vale: %s\n",currentVar)
          #print "CurrentVar es igual que oldVar"
          CurrentPeak ++
          if ( CurrentPeak > Peak) 
    	{
    	  Peak = CurrentPeak
    	  PeakLine = $0
    	}
        } else 
    
        {
          #printf ("2Current var vale: %s\n",currentVar)
          #print "CurrentVar es DIFERENTE de oldVar"
          CurrentPeak = 1
        }
      oldVar=currentVar
    }
    
    END {
    
    print "Peak per second is: " Peak
    print "Latest Peak line is: " PeakLine
    
    }
    Adrian Gibanel, IT Manager

    "be free, be innovative, bTactic"

    Av. Balmes, 34 4rt 1a B | Lleida, Spain 25006

    www.btactic.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1047
    Last Post: 03-22-2014, 05:17 AM
  2. Replies: 2
    Last Post: 02-29-2008, 02:08 PM
  3. Replies: 1
    Last Post: 10-28-2007, 01:35 AM
  4. Multi-server - Mix http and https Connections
    By soxfan in forum Administrators
    Replies: 1
    Last Post: 03-30-2007, 11:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •