Stress testing a Beaglebone web server

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
50_RAIDs_of_Cray
 
Posts: 34
Joined: Sun Oct 28, 2012 10:29 am

Stress testing a Beaglebone web server

Post by 50_RAIDs_of_Cray »

I've set up a website that is hosted off of my Beaglebone Black (running the default Debian OS) and now I want to stress test it. Are there any good programs available for linux that do load-testing for a website?

Things are made slightly more complicated by the fact that my website http://knektek7naqk2334.onion/ is hosted inside the Tor network as a hidden service, so any connections have to be routed through Tor. However it should be no problem for me to set up a tor connection for any command line programs using proxychains. I would appreciate any advice!

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Stress testing a Beaglebone web server

Post by adafruit_support_mike »

Your best bet will be to stress test it offline (in an isolated network) without going through TOR, then reconnect it to TOR once you know what it can stand.

Create a set of directories that hold about 100 files each, with sizes ranging from 1k to 1M. Put them all in a single directory your webserver will display online, then set up a few machines on a local network running `wget -r --delete-after [url]` for that base directory. If the server doesn't seem to be hitting a limit, add more wget clients.

User avatar
50_RAIDs_of_Cray
 
Posts: 34
Joined: Sun Oct 28, 2012 10:29 am

Re: Stress testing a Beaglebone web server

Post by 50_RAIDs_of_Cray »

That's a great idea, thanks. And once I figure out any bottlenecks on the device and want to examine the router + home internet quality + device together I'll run that test from a computer that's not on the home network.

User avatar
50_RAIDs_of_Cray
 
Posts: 34
Joined: Sun Oct 28, 2012 10:29 am

Re: Stress testing a Beaglebone web server

Post by 50_RAIDs_of_Cray »

Although why would you recommend having a directory with lots of differently sized files? Why not just a 100KB file that I download over and over?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: Stress testing a Beaglebone web server

Post by adafruit_support_mike »

Filesystem latency.

The OS has to spend time reading the filesystem to locate the physical storage associated with a given filename, then it has to create the data structures and allocate memory in the process we call 'opening a file'. That front-loaded cost gets added to every file you transmit, so a 100k file would breeze through a *lot* faster than 100 1k files.

There are also behind-the-scenes issues that can mislead you. Communication with the drive is incredibly slow by CPU standards (it's been compared to knocking on a door and waiting 25 years for the answer), so the central goal of computer and OS design is to do as little on-demand communication through the 'Von Neumann Bottleneck' (the slowest part of your CPU-to-storage path) as possible.

The standard solution is called 'caching'. When you ask for a byte from a file, the OS actually loads up to a megabyte of information near that byte into RAM, because RAM is much, much faster than the disk. If the next byte you ask for is within the chunk the OS preloaded, the payoff in speed improvement is huge. A well-tuned cache preloading algorithm only misses the next request about once per [time it takes to preload a block into RAM].

In that environment, transmitting the same 100k file over and over would only read the file from disk once, and would gradually migrate the data to faster and faster blocks of cache memory. Your benchmark results would show the best possible performance, not average or worst-case performance.

Calling for a whole bunch of small files will tell you more about the server's performance for non-ideal data requests. Using lots of files with lots of different sizes will force the kernel to shuffle the information in the cache RAM, and will give you a better idea of how the machine will respond to actual use.

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”