Posts Tagged ‘Linux’

GrabPERF: What and Why

December 1st, 2008 by smp | Comments | Filed in GrabPERF, The Web, Web Performance, WebPerformance.Org

Why GrabPERF?

About four years ago, I had a bright idea that I would like to learn more about how to build and scale a small Web performance measurement platform. I’ve worked in the Web performance industry for nearly a decade now, and this was an experimental platform for me to examine and encounter many of the challenges that I see on a daily basis.

The effort was so successful and garnered enough attention during the initial blogging boom that I was able to sell the whole platform for a tiny (that is not a typo) sum to Technorati.

The name is taken from another experimental tool I wrote called GrabIT2 which uses the PHP cURL libraries to capture timings and HTML data for HTTP requests. It is an extension of my articles and writings on Web performance that started at Webperformance.org, and that have since moved to this blog.

What is GrabERF?

GrabPERF is a multi-location measurement platform, based on PERL, cURL, PHP, and MySQL that is designed to

  • Measure the base HTML or a single-object target using HTTP or HTTPS
  • Report the data to a central database (located in the San Francisco Area)
  • Report the data using a GUI or through text based download

Why not Full Pages with all Objects?

Reason 1: I work for a company that already does that. Lawyers and MBAs among you, do the math.

Reason 2: I am an analyst, not a programmer. The best I can say about my measurement script is hack job.

Why is the GrabPERF interface so clunky?

See reason 2 above.

If you want to write your own interface to the data, let me know.

Why has the interface not changed in nearly three years?

The current interface works. It’s simple, clean, and delivers the data that I and the regular users need to analyze performance issues. If there is something more that you would like to see, let me know!

I like what I see. How can I host a measurement location?

Just contact me, and I can provide you with a list of PERL modules you will need to install on your linux server. In return, I need a static IP address of the machine hosting the measurement agent.

How stable is GrabPERF?

Most of the time, I forget it’s even running. I have logged onto the servers and typed in uptime and discovered that it’s been 6 months or more since the servers have been re-booted.

It was designed to be simple, because that’s all I know how to do. The lack of complexity makes it effectively self-managing.

Shouldn’t all systems be that way?

What if my question isn’t asked / answered here?

Your should know the answer to this by now: contact me.

Tags: , , , , , , , , , , , , ,

Moving from Windows - My First Week With Ubuntu (Hardy Heron)

October 19th, 2008 by smp | Comments | Filed in Linux: Desktop, Software, Technology, The Web

For the last week, I have been using Ubuntu 8.04 (Hardy Heron) on my personal laptop. I can say that the experience has been mostly transparent for me, even with the need for a complete re-build last night after an attempt to install a complex theme replacement.

I can say that it has been transparent because I have been using Linux desktops in one form or another on an intermittent basis since 1999. When business was slow in the Fall and Winter of 2001/2002, I was the Guinea Pig in my organization to see if Linux could be a corporate replacement for Windows for all desktops and laptops.

So, when I say that the process has been transparent, you will have to realize that I have been a technical user of these desktop interfaces for a number of years. But I can say that since my first positive experiences with the Red Hat Fedora and the Ximian Gnome replacement interface, things have come a very long way.

Ubuntu 8.04 is the first real interface that seems to work predictably, efficiently, and effectively with external devices and programs that are business friendly. This is especially the case if most of the tools are Web-based, as Firefox and Opera work seamlessly. OpenOffice 2.4 can open DOCX files, and media players support most of the files I want to watch/listen to.

It prints to the home network printer.

It accesses the home file server.

I can share and synchronize files among my computers using DropBox.

Some caveats to my positive experience.

  • I work mainly on the Web
  • I do not play games
  • I have been using Linux in various forms and editions since 1999.

If you have technically savvy friend, or really want to push and expand your knowledge of computers and highly configurable operating systems, I would definitely suggest giving Ubuntu a try on the extra computer you have lying around. My laptop is at least 3.5 years old, and not anywhere near as fast as my work laptop running XP. However, with Linux, the two are comparable in speed and performance.

Go on. Try it. I know you want to.

Tags: , , , , , , , , , , , ,

Web Performance: GrabPERF Performance Measurement System Needs YOU!

September 13th, 2008 by smp | Comments | Filed in GrabPERF, The Web, Web Performance, WebPerformance.Org

In 2004-2005, as a lark, I created my own Web performance measurement system, using PERL, PHP and MySQL. In August 2005, I managed to figure out how to include remote agents.

I dubbed it…GrabPERF. An odd name, but an amalgamation of “Grab” and “Performance” that made sense to my mind at the time. I also never though that it would go beyond my house, a couple of basement servers, and a cable modem.

In the intervening three years, I have managed to:

  • scale the system to handle over 250 individual measurements
  • involve nine remote measurement locations
  • move the system to the Technorati datacenter
  • provide key operational measurement data to system visitors

Although the system lives in the Technorati datacenter and is owned by them, I provide the majority of the day-to-day maintenance on a volunteer basis, if only to try and keep my limited coding skills up.

But this post is not about me. It’s about GrabPERF.

Thanks to the help of a number of volunteers, I have measurement locations in the San Francisco Bay Area, Washington DC, Boston, Portugal, Germany and Argentina.

While this is a good spread, I am still looking to gather volunteers who can host a GrabPERF measurement location. The areas where GrabPERF has the most need are:

  • Asia-Pacific
  • South Asia (India, Pakistan, Bangladesh)
  • UK and Continental Europe
  • Central Europe, including the ancestral homeland of Polska

It would also be great to get a funky logo for the system, so if you are a graphic designer and want to create a cool GrabPERF logo, let me know.

The current measurement system requires Linux, cURL and a few add-on Perl modules. I am sure that I could work on other operating systems, I just haven’t had the opportunity to experiment.

If you or your organization can help, please contact me using the GrabPERF contact form.

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , ,

Boston Verizon Measurement Agents Retired

April 4th, 2007 by smp | Comments | Filed in GrabPERF, Web Performance

This morning, after months of increasing performance issues, and connectivity issues, I have retired the Boston Verizon measurement location. This location hosted 2 measurement agents.

The machines, hosted in my basement, are connected using Verizon FiOS, which has become increasingly flaky over the last couple of months. As well, the machines are 7 year old Pentium IIs, and require a substantial amount of spoon-feeding that I don’t have time for at the moment.

I have re-enabled the Technorati #1 Agent to fill the gap, but this leaves only 4 measurement locations running. I again put out my plea for more volunteers to host GrabPERF measurement locations. I have had one volunteer contact me about this (thanks Henrik!), and this location should be up in about 3 weeks.

If you have a spare linux box and a static IP, have I got a project for you!

PS: The contact page is fixed. It was set to auto-refresh and overwrite your e-mails. Ooooops.

Tags: , , , , ,

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , ,

GrabPERF Agent: Need More Locations

March 27th, 2007 by smp | Comments | Filed in GrabPERF, Linux: Server, Web Performance

My side project, GrabPERF, is looking for a few good measurement locations.

Right now, there are only five measurement locations, two of which are in my basement, on my personal Internet connection. I am hoping, through this pledge drive, to find a number of additional locations. Areas desperately needed include:

  • East Coast, USA
  • West Coast, USA
  • Midwest, USA
  • UK
  • Asia-Pac
  • Southeast Asia
  • Australia / New Zealand

Yeah, I know. I am asking for the world. Can’t hurt to try though.

Basic requirements are a Linux box with a static IP address. Additional requirements are documented here.

You can express your interest in hosting a measurement site by filling in the GrabPERF Contact Form or contacting me directly.

Thank you for your continuing support.

Tags: , ,

Tags: , , , , , , , , , , , , , , , , , , , , , , ,

Performance Improvement From Caching and Compression

October 3rd, 2006 by smp | Comments | Filed in Web Performance, WebPerformance.Org

This paper is an extension of the work done for another article that highlighted the performance benefits of retrieving uncompressed and compressed objects directly from the origin server. I wanted to add a proxy server into the stream and determine if proxy servers helped improve the performance of object downloads, and by how much.

Using the same series of objects in the original compression article[1], the CURL tests were re-run 3 times:

 

  1. Directly from the origin server
  2. Through the proxy server, to load the files into cache
  3. Through the proxy server, to avoid retrieving files from the origin.[2]

This series of three tests was repeated twice: once for the uncompressed files, and then for the compressed objects.[3]

As can be seen clearly in the plots below, compression caused web page download times to improve greatly, when the objects were retrieved from the source. However, the performance difference between compressed and uncompressed data all but disappears when retrieving objects from a proxy server on a corporate LAN.

uncompressed_pages

compressed_pages

Instead of the linear growth between object size and download time seen in both of the retrieval tests that used the origin server (Source and Proxy Load data), the Proxy Draw data clearly shows the benefits that accrue when a proxy server is added to a network to assist with serving HTTP traffic.

  MEAN DOWNLOAD TIME
Uncompressed Pages
Total Time Uncompressed — No Proxy 0.256
Total Time Uncompressed — Proxy Load 0.254
Total Time Uncompressed — Proxy Draw 0.110
Compressed Pages
Total Time Compressed — No Proxy 0.181
Total Time Compressed — Proxy Load 0.140
Total Time Compressed — Proxy Draw 0.104

The data above shows just how much of an improvement is gained by adding a local proxy server, explicit caching descriptions and compression can add to a Web site. For sites that do force a great of requests to be returned directly to the origin server, compression will be of great help in reducing bandwidth costs and improving performance. However, by allowing pages to be cached in local proxy servers, the difference between compressed and uncompressed pages vanishes.

Conclusion

Compression is a very good start when attempting to optimize performance. The addition of explicit caching messages in server responses which allow proxy servers to serve cached data to clients on remote local LANs can improve performance to even a greater extent than compression can. These two should be used together to improve the overall performance of Web sites.


[1]The test set was made up of the 1952 HTML files located in the top directory of the Linux Documentation Project HTML archive.

[2]All of the pages in these tests announced the following server response header indicating its cacheability:

Cache-Control: max-age=3600

[3]A note on the compressed files: all compression was performed dynamically by mod_gzip for Apache/1.3.27.

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Performance Improvement From Compression

October 3rd, 2006 by smp | Comments | Filed in Web Performance, WebPerformance.Org

How much improvement can you see with compression? The difference in measured download times on a very lightly loaded server indicates that the time to download the Base Page (the initial HTML file) improved by between 1.3 and 1.6 seconds across a very slow connection when compression was used.

Base Page Performance
Base Page Performance

There is a slightly slower time for the server to respond to a client requesting a compressed page. Measurements show that the median response time for the server averaged 0.23 seconds for the uncompressed page and 0.27 seconds for the compressed page. However, most Web server administrators should be willing to accept a 0.04 increase in response time to achieve a 1.5 second improvement in file transfer time.

First Byte Performance
First Byte Performance

Web pages are not completely HTML. How do improved HTML (and CSS) download times affect overall performance? The graph below shows that overall download times for the test page were 1 to 1.5 seconds better when the HTML files were compressed.

Total Page Performance
Total Page Performance

To further emphasize the value of compression, I ran a test on a Web server to see what the average compression ratio would be when requesting a very large number of files. As well, I wanted to determine what the affect on server response time would be when requesting large numbers of compressed files simultaneously. There were 1952 HTML files in the test directory and I checked the results using CURL across my local LAN.[1]


Large sample of File Requests (1952 HTML Files)

mod_gzip

Uncompressed Compressed
First Byte
Mean 0.091 0.084
Median 0.030 0.036
Total Time
Mean 0.280 0.128
Median 0.173 0.079
Bytes per Page
Mean 6349 2416
Median 3750 1543
Total Bytes 12392318 4716160

mod_deflate[2]

Uncompressed Compressed
First Byte
Mean 0.044 0.046
Median 0.028 0.031
Total Time
Mean 0.241 0.107
Median 0.169 0.050
Bytes per Page
Mean 6349 2418
Median 3750 1544
Total Bytes 12392318 4720735
mod_gzip mod_deflate
Average Compression 0.433 0.438
Median Compression 0.427 0.427

As expected, the First Byte download time was slightly higher with the compressed files than it was with the uncompressed files. But this difference was in milliseconds, and is hardly worth mentioning in terms of on-the-fly compression. It is unlikely that any user, especially dial-up users, would notice this difference in performance.That the delivered data was transformed to 43% of the original file size should make any Web administrator sit up and notice. The compression ratio for the test files ranged from no compression for files that were less than 300 bytes, to 15% of original file size for two of the Linux SCSI Programming HOWTOs. Compression ratios do not increase in a linear fashion when compared to file size; rather, compression depends heaviliy on the repetition of content within a file to gain its greatest successes. The SCSI Programming HOWTOs have a great deal of repeated characters, making them ideal candidates for extreme compression.Smaller files also did not compress as well as larger files, exactly for this reason. Fewer bytes means a lower probability of repeated bytes, resulting in a lower compression ratio.


Average Compression by File Size

mod_gzip mod_deflate
0-999 0.713 0.777[3]
1000-4999 0.440 0.440
5000-9999 0.389 0.389
10000-19999 0.369 0.369
20000-49999 0.350 0.350
50000 and up 0.329 0.331

The data shows that compression works best on files larger than 5000 bytes; after that size, average compression gains are smaller, unless a file has a large number of repeated characters. Some people argue that compressing files below a certain size is a wasteful use of CPU cycles. If you agree with these folks, using the 5000 byte value as floor value for compressing files should be a good starting point. I am of the opposite mindset: I compress everything that comes off my servers because I consider myself an HTTP overclocker, trying to squeeze every last bit of download performance out of the network.

Conclusion

With a few simple commands, and a little bit of configuration, an Apache Web server can be configured to deliver a large amount of content in a compressed format. These benefits are not simply limited to static pages; dynamic pages generated by PHP and other dynamic content generators can be compressed by using the Apache compression modules. When added other performance tuning mechanisms and appropriate server-side caching rules, these modules can substantially reduce the bandwidth for a very low cost.


[1] The files were the top level HTML files from the Linux Documentation Project. They were installed on an Apache 1.3.27 server running mod_gzip and an Apache 2.0.44 server using mod_deflate. Minimum file size was 80 bytes and maximum file size was 99419 bytes.

[2] mod_deflate for Apache/2.0.44 and earlier comes with the compression ratio set for Best Speed, not Best Compression. This configuration can be modified using the tips found here; and starting with Apache/2.0.45, there will be a configuration directive that will allow admins to configure the compression ratio that they want.

In this example, the compression ratio was set to Level 6.

[3] mod_deflate does not have a lower bound for file size, so it attempts to compress files that are too small to benefit from compression. This results in files smaller than approximately 120 bytes becoming larger when processed by mod_deflate.

Tags: , , , , , , , , , , , , , ,

Baseline Testing With cURL

October 3rd, 2006 by smp | Comments | Filed in Web Performance, WebPerformance.Org

cURL is an application that can be used to retrieve any Internet file that uses the standard URL format — http://, ftp://, gopher://, etc. Its power and flexibility can be added to applications by using the libcurl library, whose API can be accessed easily using most of the commonly used scripting and programming languages.

So, how does cURL differ from some of the other command-line URL retrieval tools such as WGET? Both do very similar things, and can be coaxed to retrieve large lists of files or even mirror entire Web sites. In fact, for the automated retrieval of single files for the Internet for storage on local filesystems — such as downloading source files onto servers for building applications — WGET’s syntax is the simplest to use.

However, for simple baseline testing, WGET lacks cURL’s ability to produce timing results that can be written to an output file in a user-configurable format. cURL gathers a large amount of data about a transfer that can then be used for analysis or logging purposes. This makes it a step ahead of WGET for baseline testing.

cURL Installation

For the purposes of our testing, we have used cURL 7.10.5-pre2 as it adds support for downloading and interpreting GZIP-encoded content from Web servers. Because it is a pre-release version, it is currently only available as source for compiling. The compilation was smooth, and straight-forward.

$ ./configure --with-ssl --with-zlib
$ make
$ make test

[...runs about 120 checks to ensure the application and library will work as expected..]

# make install

The application installed in /usr/local/bin on my RedHat 9.0 laptop.

Testing cURL is straight-forward as well.

$ curl http://slashdot.org/

[...many lines of streaming HTML omitted...]

Variations on this standard theme include:

  • Send output to a file instead of STDOUT
  • 	$ curl -o ~/slashdot.txt http://slashdot.org/
  • Request compressed content if the Web server supports it
  • 	$ curl --compressed http://slashdot.org/
  • Provide total byte count for downloaded HTML
  • 	$ curl -w %{size_download} http://slashdot.org/

    Baseline Testing with cURL

    With the application installed, you can now begin to design a baseline test. This methodology is NOT a replacement for true load testing, but rather a method for giving small and medium-sized businesses a sense of how well their server will perform before it is deployed into production, as well as providing a baseline for future tests. This baseline can then be used as a basis for comparing performance after configuration changes in the server environment, such as caching rule changes or adding solutions that are designed to accelerate Web performance.

    To begin, a list of URLs needs to be drawn up and agreed to as a baseline for the testing. For my purposes, I use the files from the Linux Documentation project, intermingled with a number of images. This provides the test with a variety of file sizes and file types. You could construct your own file-set out of any combination of documents/files/images you wish. However, the file-set should be large — mine runs to 2134 files.

    Once the file-set has been determined, it should be archived so that this same group can be used for future performance tests; burning it to a CD is always a safe bet.

    Next, extract the filenames to a text file so that the configuration file for the tests can be constructed. I have done this for my tests, and have it set up in a generic format so that when I construct the configuration for the next test, I simply have to change/update the URL to reflect the new target.

    The configuration of the rest of the parameters should be added to the configuration file at this point. These are all the same as the command line versions, except for the URL listing format.

  • Listing of test_config.txt
  • -A "Mozilla/4.0 (compatible; cURL 7.10.5-pre2; Linux 2.4.20)"
    -L
    -w @logformat.txt
    -D headers.txt
    -H "Pragma: no-cache"
    -H "Cache-control: no-cache"
    -H "Connection: close"
    
    url="http://www.foobar.com/1.html"
    url="http://www.foobar.com/2.png"
    [...file listing...]

    In the above example, I have set cURL to:

    • Use a custom User-Agent string
    • Follow any re-direction responses that contain a “Location:” response header
    • Dump the server response headers to headers.txt
    • Circumvent cached responses by sending the two main “no-cache” request headers
    • Close the TCP connection after each object is downloaded, overriding cURL’s default use of persistent connections
    • Format the timing and log output using the format that is described in logformat.txt

    Another command-line option that I use a lot is –compressed, which, as of cURL 7.10.5, handles both the deflate and gzip encoding of Web content, including decompression on the fly. This is great for comparing the performance improvements and bandwidth savings from compression solutions against a baseline test without compression. Network administrators may also be interested in testing the improvement that they get using proxy servers and client-side caches by inserting –proxy <proxy[:port]> into the configuration, removing the “no-cache” headers, and testing a list of popular URLs through their proxy servers.

    The logformat.txt file describes the variables that I find of interest and that I want to use for my analysis.

  • Listing of logformat.txt
  • n
    %{url_effective}t%{http_code}t%{content_type}t%{time_total}t%{time_lookup}t /
    	%{time_connect}t%{time_starttransfer}t{size_download}n
    n

    These variables are defined as:

  • url_effective: URL used to make the final request, especially when following re-directions
  • http_code: HTTP code returned by the server when delivering the final HTML page requested
  • content_type: MIME type returned in the final HTML request
  • time_total: Total time for the transfer to complete
  • time_lookup: Time from start of transfer until DNS Lookup complete
  • time_connect: Time from start of transfer until TCP connection complete
  • time_starttransfer: Time from start of transfer until data begins to be returned from the server
  • size_download: Total number of bytes transferred, excluding headers
  • As time_connect and time_starttransfer are cumulative from the beginning of the transfer, you have to do some math to come up with the actual values.

    TCP Connection Time = time_connect - time_lookup
    Time First Byte = time_starttransfer - time_connect
    Redirection Time = time_total - time_starttransfer

    If you are familiar with cURL, you may wonder why I have chosen not to write the output to a file using the -o <file> option. It appears that this option only records the output for the first file requested, even in a large list of files. I prefer to use the following command to start the test and then post-process the results using grep.

    $ curl -K test_config.txt >> output_raw_1.txt
    
    [...lines and lines of output...]
    
    $ grep -i -r "^http://www.foobar.com/.*$" output_raw_1.txt >> output_processed_1.txt

    And voila! You now have a tab delimited file you can drop into your favorite spreadsheet program to generate the necessary statistics.

    Tags: , , , , , , , , , , , , , , ,

    GrabPERF: GZIP Performance Experiment Revisited

    August 23rd, 2006 by smp | Comments | Filed in Uncategorized

    A few years ago, I wrote an article on how GZIP compression improved Web performance. Don Marti at the Linux Journal was a great editor, and eventually, the article ended up in the online version of the Magazine.

    At the time, I used Ian Holsman’s webperf.org (now renamed ITScales) to capture the data. Now that I have built my own Web performance monitoring network, I thought I would repeat the experiment.

    You can see the comparative results at these locations:

    After I have collected a lot more data, I will be re-visiting the article and commenting on the state of compression technology on the Internet.

    If you would like to suggest a site to measure, please leave a comment.

    Technorati Tags: , , , , ,

    Tags: , , , , , , , , , , , , , , , , , , , , , , , , ,

    GrabPERF: For Sale — The Original Servers

    July 23rd, 2006 by smp | Comments | Filed in GrabPERF, Technology

    As everyone should know by now, GrabPERF has moved to some pretty swell co-lo digs provided by our friends at Technorati. This saved us a bunch of money, both in connectivity and in power.

    Now, after nearly 6 months of inactivity, I have decided to sell the original GrabPERF servers. I have no more need for them, and if I was ever to do something like GrabPERF again, I would do it on much more modern hardware.

    These two twin PIII 600MHz machines have done stellar work, given that they are at least seven (that’s right, 7) years old. They are rock solid running Linux; your mileage may vary running other OSes.

    These are defintely NOT desktop machines. People at the local Air Base asked me to keep the noise down. They have less than stellar video cards and no sound cards. These are servers.

    These workhorses can be seen in an annotated context here. Until you go there, here is the old GrabPERF rack, just for the memories.

    The GrabPERF Rack

    Technorati Tags: , ,

    Tags: , , , , , , , , , , , , , , , , ,