Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Apache SSI: Web Server With A Side of Includes

Sean Yo
February 02, 2012

Apache SSI: Web Server With A Side of Includes

Using a server-side language just in include code? Check out some Old Skool tools - Apache Server Side Includes.

Sean Yo

February 02, 2012
Tweet

More Decks by Sean Yo

Other Decks in Technology

Transcript

  1. @seanyo seanyo.ca [email protected] a simple interpreted server-side scripting language for

    the Web. Reintroducing Apache SSI Turing Complete First introduced in 1997 in NCSA httpd Wrapped in HTML comment markup
  2. @seanyo seanyo.ca [email protected] <!--#element attribute=value attribute=value ... --> SSI Features

    Element Description config configure output formats echo print variables exec execute external programs fsize print size of a file flastmod print last modification time of a file include include a file printenv print all available variables set set a value of a variable
  3. @seanyo seanyo.ca [email protected] <body> <div id="wrapper"> <!--#include virtual="includes/header.inc" --> <div

    id="main-content"> <div id="left-column"> <div id="logo"><img src="images/big-paw.gif“ /> <h2>Vomit Free Since ‘93</h2> </div> <div class="box"> . . . <!--#include virtual="includes/sidebar.inc" --> </div> <!--#include virtual="includes/footer.inc" --> </body> Show Me The Code!
  4. @seanyo seanyo.ca [email protected] APACHE THE GIANT Well, you see, you

    use different moves when you're coding with half a dozen tools than when you only have to be worried about…one.
  5. @seanyo seanyo.ca [email protected] This can give SSI a A bit

    of a performance boost SSI: Cache-ibly Delicious
  6. @seanyo seanyo.ca [email protected] THE XBIT HACK Yo Dawg. I heard

    you like includes on your website, so I put some includes in your includes so you can include them while you code
  7. @seanyo seanyo.ca [email protected] About The Same… GO GO Code Racer!

    *** HTML & CSS *** > ab ‐n 25000 ‐c 10 http://sean.dreamhosters.com/pets This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking sean.dreamhosters.com (be patient) Completed 2500 requests Completed 5000 requests Completed 7500 requests Completed 10000 requests Completed 12500 requests Completed 15000 requests Completed 17500 requests Completed 20000 requests Completed 22500 requests Completed 25000 requests Finished 25000 requests Server Software: Apache Server Hostname: sean.dreamhosters.com Server Port: 80 Document Path: /pets Document Length: 242 bytes Concurrency Level: 10 Time taken for tests: 11.961 seconds Complete requests: 25000 Failed requests: 608 (Connect: 0, Receive: 0, Length: 608, Exceptions: 0) Write errors: 0 Non‐2xx responses: 25000 Total transferred: 12104792 bytes HTML transferred: 6099248 bytes Requests per second: 2090.15 [#/sec] (mean) Time per request: 4.784 [ms] (mean) Time per request: 0.478 [ms] (mean, across all concurrent requests) Transfer rate: 988.32 [Kbytes/sec] received Connection Times (ms) min mean[+/‐sd] median max Connect: 0 1 1.6 1 38 Processing: 0 3 39.1 1 978 Waiting: 0 3 39.1 1 978 Total: 1 5 39.2 2 978 Percentage of the requests served within a certain time (ms) 50% 2 66% 2 75% 3 80% 4 90% 4 95% 5 98% 12 99% 19 100% 978 (longest request) *** With SSI, XBitHack Full *** ab ‐n 25000 ‐c 10 http://sean.dreamhosters.com/pets This is ApacheBench, Version 2.3 <$Revision: 655654 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking sean.dreamhosters.com (be patient) Completed 2500 requests Completed 5000 requests Completed 7500 requests Completed 10000 requests Completed 12500 requests Completed 15000 requests Completed 17500 requests Completed 20000 requests Completed 22500 requests Completed 25000 requests Finished 25000 requests Server Software: Apache Server Hostname: sean.dreamhosters.com Server Port: 80 Document Path: /pets Document Length: 242 bytes Concurrency Level: 10 Time taken for tests: 12.838 seconds Complete requests: 25000 Failed requests: 771 (Connect: 0, Receive: 0, Length: 771, Exceptions: 0) Write errors: 0 Non‐2xx responses: 25000 Total transferred: 12112779 bytes HTML transferred: 6112451 bytes Requests per second: 1947.37 [#/sec] (mean) Time per request: 5.135 [ms] (mean) Time per request: 0.514 [ms] (mean, across all concurrent requests) Transfer rate: 921.41 [Kbytes/sec] received Connection Times (ms) min mean[+/‐sd] median max Connect: 0 1 1.3 1 42 Processing: 0 4 43.3 1 982 Waiting: 0 4 43.3 1 982 Total: 0 5 43.3 2 982 Percentage of the requests served within a certain time (ms) 50% 2 66% 2 75% 2 80% 3 90% 4 95% 4 98% 9 99% 15 100% 982 (longest request)