Apache Architecture
Pratyush Majumdar
APACHE(1 of 3)
• Static Requests (No API Hits)
• Content Pages (Promotions, How to Play etc.)
• Dynamic Requests (API Hits)
• Landing Pages
• Post Login Pages
• Static (Content Pages)
• Dynamic (My Profile, Transaction Details, Withdrawal etc.)
APACHE(2 of 3)
• URLs and Resource Consumption
• Static links like images, css, javascripts, fonts
• favicon.ico
• JSON
• Content Links (DB Hits)
• Dynamic Links (DB Hits as well as API Hits)
APACHE(3 of 3)
• Database – Query Caching
• Progressive Caching
• Page Caching
• Varnish (Only Landing Pages)
• Page Served (on Browser)
• HTML Minification
• Javascript/CSS/Images Minification
• Static links Expiry
Threshold Values
• httpd process(MPMs – Prefork and Worker)
• Disk IO
• CPU
• RAM
• Database Connections
• Network IO
Apache Optimization
• MPM
• Targets memory consumption only
• Limits traffic to reduce CPU keeping traffic in queue
• Queued requests can be dropped, no logs
MaxClients/ServerLimit
StartServers
MinSpareServers
MaxSpareServers
MaxConnectionsPerChild
Apache Commands
• Command to count individual URLs
• cat access.log | cut -d" -f2 | awk '{print $1 " " $2}' | cut -d? -f1 | sort | uniq -c
| sort –n
• Command to count total URLs per minute
• grep "05/Jan/2018:" access.log | cut -d[ -f2 | cut -d] -f1 | awk -F: '{print
$2":"$3}' | sort -nk1 -nk2 | uniq -c | awk '{ if ($1 > 10) print $0}'

Apache architecture

  • 1.
  • 3.
    APACHE(1 of 3) •Static Requests (No API Hits) • Content Pages (Promotions, How to Play etc.) • Dynamic Requests (API Hits) • Landing Pages • Post Login Pages • Static (Content Pages) • Dynamic (My Profile, Transaction Details, Withdrawal etc.)
  • 4.
    APACHE(2 of 3) •URLs and Resource Consumption • Static links like images, css, javascripts, fonts • favicon.ico • JSON • Content Links (DB Hits) • Dynamic Links (DB Hits as well as API Hits)
  • 5.
    APACHE(3 of 3) •Database – Query Caching • Progressive Caching • Page Caching • Varnish (Only Landing Pages) • Page Served (on Browser) • HTML Minification • Javascript/CSS/Images Minification • Static links Expiry
  • 6.
    Threshold Values • httpdprocess(MPMs – Prefork and Worker) • Disk IO • CPU • RAM • Database Connections • Network IO
  • 9.
    Apache Optimization • MPM •Targets memory consumption only • Limits traffic to reduce CPU keeping traffic in queue • Queued requests can be dropped, no logs MaxClients/ServerLimit StartServers MinSpareServers MaxSpareServers MaxConnectionsPerChild
  • 10.
    Apache Commands • Commandto count individual URLs • cat access.log | cut -d" -f2 | awk '{print $1 " " $2}' | cut -d? -f1 | sort | uniq -c | sort –n • Command to count total URLs per minute • grep "05/Jan/2018:" access.log | cut -d[ -f2 | cut -d] -f1 | awk -F: '{print $2":"$3}' | sort -nk1 -nk2 | uniq -c | awk '{ if ($1 > 10) print $0}'