How to use an ab bench

Apache Bench, or ab for short, is a command line tool for performing simple load tests on an HTTP server, be it a website or an API.

By running the following command, you will get an overview of how the server works under load:

Therefore, in this post I will try to explain how we can use Apache Bench. I’ll start with how to install it, then move on to using and available options, and finally explain how to interpret the results.

Let’s begin!

Installation

One of the advantages of Apache Bench is that you may already have ab installed, depending on the operating system you are using. For macOS users, it comes pre-installed by default, and if you’re using a Linux distribution, chances are it’s installed as well as it comes with the httpd package. Try to run ab – help to verify if that’s the case.

If it is not installed you will need to install the apache2-utils package. For example, if you are using Ubuntu, you will need to run:

Now that we have Apache Bench installed, let’s see how we can use it and some of the options available.

Use

The simplest possible way to use Apache Bench is to run ab. This command will make a single network request, but it’s not quite what we would call “loading”. For this reason, Apache Bench includes a lot of options that can be used to define more complex use cases.

Here are some of the most useful:

  • -n: number of requests
  • -c: number of concurrent requests
  • -H: Add header
  • —R: flag to forbid the exit in case of errors in the reception by the socket
  • -k: Use the KeepAlive HTTP function
  • -p: file containing data for POST
  • -T: content type header to use for POST / PUT data,

Now you can use these options like:

Remember that you need the end / in url, otherwise you will get the error message ab: invalid url.

If you want to benchmark a POST request, you can run the following command:

TIP: For a complete list of options, you can run ab – help, visit the man page by running man ab, or visit the online documentation.

Now let’s see how the result would be and how to interpret it!

Interpret the answer

When ab completes HTTP requests, it will generate output similar to the following snippet:

In this first section you can find some useful information such as that the number of complete requests was 1000 and the concurrency level was 10. Also, you can see that it made 1264.17 requests per second.

In the Connection Times section, you can see that the fastest request took 3 ms ( Total row and min column), the slowest took 111 ms ( Total row and max column), while the mean was 7 ms ( Total row & mean column).

In the last section, you’ll get an overview of response times in stacked distribution. In this example, we can see that 95% of requests took 8ms or less and a total response time greater than 100ms is an outlier because it is less than 1% of the sample.

Application

And that’s about for this intro on Apache Bench! At this point, you should be able to use the ab command to perform load tests on the HTTP server and get detailed information about the results.

Finally, I would say that Apache Bench is the perfect solution if you want to do a quick load test as it is probably already installed on your computer and is really easy to use. If you want to cover more advanced use cases like random URL streams and entries, I think there are other more modern and comprehensive tools out there. Some examples include J meter, K6 and Gatling.

Thanks for reading, I hope this post is useful to you and if you have any questions or comments about this post please feel free to contact me on Twitter!

By Robert Qualls

Posted November 25, 2013.

introduction

Load testing is a good idea before any deployment. It’s nice to quickly establish a best-case scenario for a project before running more detailed tests down the road.

ApacheBench (ab) can load test servers by sending any number of concurrent requests. Although ab was designed to test Apache installations, it can be used to test any HTTP server.

In this tutorial we will see how the Ruby interpreter works with different servers under load. The tutorial steps assume a new Ubuntu 13.10 x32 image. The results were obtained with a droplet size of 512 MB.

Installation

Update the package database.

Install the apache2-utils package to access the ApacheBench.

User with limited privileges

Then create a user to manage Ruby. It’s not a good idea to run some of the commands in the next section as root.

What this command is for:

useradd – create a new user

-m – create a home directory

-d / home / test – sets the user’s home directory to / home / test

-s / bin / bash – sets the user’s shell default bash (Ubuntu uses a dash by default)

-g sudo – add a user to the sudo group (to execute commands from sudo)

test – name of the new user

Set a password for the new user.

Switch to the new user.

The Ruby version manager makes it easier to work with different Ruby environments. Manages the installation process of specific Ruby versions and the isolation of gems. It is currently installed by running a bash script from their website.

To use the rvm command, you must first run the rvm script.

If you want, you can insert it into yours. bashrc to make rvm available every time you log in as a user.

You can check if the rvm script is being used by checking the type header. It should be a function, not a hash.

Then install Ruby 2.0.0. RVM will ask for the user’s password because it needs to install an assortment of dependencies before it can make Ruby. Since RVM compiles Ruby from source, this step may take some time.

Switch to the new Ruby. This might happen by default after the installation, but checking doesn’t hurt.

Test

Now that Ruby is installed, you can create a simple site and see how many requests it can handle.

Install Sinatra. It’s a microframework/DSL for creating Ruby web applications. Flags – no – * skip documentation.

Crea un’applicazione Sinatra di esempio che assomigli a "ciao mondo".

Once the server is ready, you can begin the load test. The call to ab looks like this:

Open another terminal and ssh back to the server. Test with ApacheBench. I used 1000 requests with a concurrency of 100. Don’t forget the final ’/’ for the path.

My results were about 300 requests per second. WEBrick is not known for his speed. Go ahead and end the server with Ctrl-c.

Install slim

Thin is a popular Ruby web server that uses Mongrel for analytics and EventMachine for non-blocking IO. Install slim and run the server again. Sinatra should automatically load Thin and let you know (“… backed up with Thin”).

Now try the load test again. It should be a little faster this time.

At least in this case, it appears that Thin provides a much faster server than WEBrick with over 700 requests per second (you can try to increase the total number of requests, but it wasn’t much higher for me).

Note: I was able to get 1000 requests per second on the Arch Linux droplet.

Application

Of course, these results do not reflect realistic server performance. HTTP is just one piece of the puzzle. A slow model engine and / or database will significantly reduce these numbers. However, it does provide a quick result for comparison.

Other performance tools you might be interested in:

  • HTTPperf
  • weight, etc.
  • https: //
  • siege
  • J meter
  • tourist bus

This tool could be the key to a stronger and more stable set of abdominal muscles.

How to use an ab bench

Today’s abdominal exercises are more versatile than ever. Sure, you can work your way through sets of squats and plank turns over and over again. Increasingly, however, core training uses tools such as Swiss balls, medicine balls, dumbbells, and kettlebells. And if you’re looking for another way to spice up your abdominal workout, it’s time to consider the belly wheel.

It’s easy to forget the ab-wheel, the classic abdominal training machine that’s been around for years. But it’s a tool you definitely want to use. How come? Because, perhaps more than any other core training gadget, the Abdominal Wheel gives you the ability to train your entire core (abs, gluten, lower back, and obliques) as a unit. Your core works this way – as an individual – in real life, so any opportunity to train it this way is a win-win.

How to use an ab bench

The best thing about the AB wheel is how it trains something called “anti-extension”. As an individual, your core is responsible for the quintet of key activities. Helps to rotate the torso (as in Russian twists). It is resistant to rotation, an idea called “anti-rotation” that you struggle with while holding the Pallof. It also strengthens the spine (think hollow boards and holds) and stiffens the spine (as is the case with classic sit-ups).

Then comes the idea of ​​”anti-extension”, and it’s about preventing the back from flexing too much. Yes, arching your back can be a good stretch, and in some situations you want to. But it is a set of strong abdominal and oblique muscles that prevent you from living in a back arched position, thus protecting your spine and allowing you to develop shoulder mobility. Were it not for the abdominal muscles to keep your back from arching constantly, you would constantly put stress on your lower back with each exercise.

There are other ways to practice anti-pull (think sliding off weighted hollow boards and grips). But the abdominal wheel allows you to challenge this anti-enlargement in new ways. It is also a simple tool. If you don’t have access to a lap wheel, you can almost always do it yourself using a barbell with rounded plates on “wheels” or even using a towel or sliders on a super smooth floor.

How to use an ab bench

However, implementing the ab wheel isn’t easy, or at least it’s not easy to do it correctly. Take your time to go through the proper progress of the implementation; it will protect your back in the long run while building fundamental core strength.

Progression of the development of the AB circle

A key mistake people make when rolling out: they focus excessively on development as far away as possible when they start. However, this is a recipe for back pain. You must learn to feel your abs struggle against the extension of the lower back before completing the extension of the abdominal circle; if you don’t, you are putting a strain on your spine.

Rollers on inclined bench

Avoid this, starting with the slope progression. Place the bench at a 30 degree angle to begin the workout. Position yourself in a solid plank standing position, glutes and abs occupied, keeping the belly circle on the bench seat. Stretch your arms to slowly roll the circle onto the bench, counting to five, keeping the board firmly in place as you move onto the bench.

Maintain a soft curve in the elbows and only go as far as possible. If you are a person with arm problems, do not straighten your arms completely. Inserting the AB wheel should not cause shoulder pain.

Mentre ti muovi, concentrati a mantenere il busto teso e a mantenere la tua posizione leggermente arrotondata. Contract your abs and the more your arms are pushed forward, the more you should contract your abs. By doing this you are actively teaching your abs to work on “anti-expansion”.

Kneeling rollout

Try this set until you feel comfortable in this position, then lower the bench until it is in the standard position. Then you will be ready to go out on the dance floor where the actual exercise takes place. To save your knees, you’ll want to kneel on a yoga mat or pad.

Once on the ground, your main goal will be to stay in a strong stance while running, fighting the forces that will keep your lower back stiffened and your hips curving forward. Contract your abs aggressively and actively, even when you don’t feel necessary. Implementation is not difficult. The challenge is to stumble while controlling the position of the lower back.

Do the same movement, once again focusing on maintaining a slow, controlled unwind, squeezing the core to pull the wheel back towards you. For now, you should skip the last video progression below, standing up until you’ve built up strength by performing the more standard version on your knees.

Apache Bench (ab) is a Hypertext Transfer Protocol (HTTP) server benchmarking and load testing tool. It can be run from the command line and is very easy to use. Quick load test results can be obtained in just one minute. Since it does not require too much knowledge of the concept of load and performance testing, it is suitable for novice and intermediate users. No complicated configuration is required to use this tool. It is also installed automatically with the Apache web server or can be installed separately as an Apache utility. It doesn’t have all the features of popular tools like jMeter or Grinder, but it’s a good place to start.

This tutorial is intended for application developers and system administrators who want to learn Apache Bench in simple and easy steps. This tutorial will give you a working knowledge of Apache Bench and, after completing this tutorial, you will find yourself at an intermediate level of knowledge, from where you can move on to a higher level of knowledge.

Before continuing with this tutorial, you should have a basic understanding of the command line interface (CLI), HTTP, text editor and web server, etc. As you will need these tools to successfully run Apache Bench for load testing. In addition, it will be helpful to be familiar with the web development and application testing processes.

This tool could be the key to a stronger and more stable set of abdominal muscles.

How to use an ab bench

Today’s abdominal exercises are more versatile than ever. Sure, you can work your way through sets of squats and plank turns over and over again. Increasingly, however, core training uses tools such as Swiss balls, medicine balls, dumbbells, and kettlebells. And if you’re looking for another way to spice up your abdominal workout, it’s time to consider the belly wheel.

It’s easy to forget the ab-wheel, the classic abdominal training machine that’s been around for years. But it’s a tool you definitely want to use. How come? Because, perhaps more than any other core training gadget, the Abdominal Wheel gives you the ability to train your entire core (abs, gluten, lower back, and obliques) as a unit. Your core works this way – as an individual – in real life, so any opportunity to train it this way is a win-win.

How to use an ab bench

The best thing about the AB wheel is how it trains something called “anti-extension”. As an individual, your core is responsible for the quintet of key activities. Helps to rotate the torso (as in Russian twists). It is resistant to rotation, an idea called “anti-rotation” that you struggle with while holding the Pallof. It also strengthens the spine (think hollow boards and holds) and stiffens the spine (as is the case with classic sit-ups).

Then comes the idea of ​​”anti-extension”, and it’s about preventing the back from flexing too much. Yes, arching your back can be a good stretch, and in some situations you want to. But it is a set of strong abdominal and oblique muscles that prevent you from living in a back arched position, thus protecting your spine and allowing you to develop shoulder mobility. Were it not for the abdominal muscles to keep your back from arching constantly, you would constantly put stress on your lower back with each exercise.

There are other ways to practice anti-pull (think sliding off weighted hollow boards and grips). But the abdominal wheel allows you to challenge this anti-enlargement in new ways. It is also a simple tool. If you don’t have access to a lap wheel, you can almost always do it yourself using a barbell with rounded plates on “wheels” or even using a towel or sliders on a super smooth floor.

How to use an ab bench

However, implementing the ab wheel isn’t easy, or at least it’s not easy to do it correctly. Take your time to go through the proper progress of the implementation; it will protect your back in the long run while building fundamental core strength.

Progression of the development of the AB circle

A key mistake people make when rolling out: they focus excessively on development as far away as possible when they start. However, this is a recipe for back pain. You must learn to feel your abs struggle against the extension of the lower back before completing the extension of the abdominal circle; if you don’t, you are putting a strain on your spine.

Rollers on inclined bench

Avoid this, starting with the slope progression. Place the bench at a 30 degree angle to begin the workout. Position yourself in a solid plank standing position, glutes and abs occupied, keeping the belly circle on the bench seat. Stretch your arms to slowly roll the circle onto the bench, counting to five, keeping the board firmly in place as you move onto the bench.

Maintain a soft curve in the elbows and only go as far as possible. If you are a person with arm problems, do not straighten your arms completely. Inserting the AB wheel should not cause shoulder pain.

Mentre ti muovi, concentrati a mantenere il busto teso e a mantenere la tua posizione leggermente arrotondata. Contract your abs and the more your arms are pushed forward, the more you should contract your abs. By doing this you are actively teaching your abs to work on “anti-expansion”.

Kneeling rollout

Try this set until you feel comfortable in this position, then lower the bench until it is in the standard position. Then you will be ready to go out on the dance floor where the actual exercise takes place. To save your knees, you’ll want to kneel on a yoga mat or pad.

Once on the ground, your main goal will be to stay in a strong stance while running, fighting the forces that will keep your lower back stiffened and your hips curving forward. Contract your abs aggressively and actively, even when you don’t feel necessary. Implementation is not difficult. The challenge is to stumble while controlling the position of the lower back.

Do the same movement, once again focusing on maintaining a slow, controlled unwind, squeezing the core to pull the wheel back towards you. For now, you should skip the last video progression below, standing up until you’ve built up strength by performing the more standard version on your knees.

By Robert Qualls

Posted November 25, 2013.

introduction

Load testing is a good idea before any deployment. It’s nice to quickly establish a best-case scenario for a project before running more detailed tests down the road.

ApacheBench (ab) can load test servers by sending any number of concurrent requests. Although ab was designed to test Apache installations, it can be used to test any HTTP server.

In this tutorial we will see how the Ruby interpreter works with different servers under load. The tutorial steps assume a new Ubuntu 13.10 x32 image. The results were obtained with a droplet size of 512 MB.

Installation

Update the package database.

Install the apache2-utils package to access the ApacheBench.

User with limited privileges

Then create a user to manage Ruby. It’s not a good idea to run some of the commands in the next section as root.

What this command is for:

useradd – create a new user

-m – create a home directory

-d / home / test – sets the user’s home directory to / home / test

-s / bin / bash – sets the user’s shell default bash (Ubuntu uses a dash by default)

-g sudo – add a user to the sudo group (to execute commands from sudo)

test – name of the new user

Set a password for the new user.

Switch to the new user.

The Ruby version manager makes it easier to work with different Ruby environments. Manages the installation process of specific Ruby versions and the isolation of gems. It is currently installed by running a bash script from their website.

To use the rvm command, you must first run the rvm script.

If you want, you can insert it into yours. bashrc to make rvm available every time you log in as a user.

You can check if the rvm script is being used by checking the type header. It should be a function, not a hash.

Then install Ruby 2.0.0. RVM will ask for the user’s password because it needs to install an assortment of dependencies before it can make Ruby. Since RVM compiles Ruby from source, this step may take some time.

Switch to the new Ruby. This might happen by default after the installation, but checking doesn’t hurt.

Test

Now that Ruby is installed, you can create a simple site and see how many requests it can handle.

Install Sinatra. It’s a microframework/DSL for creating Ruby web applications. Flags – no – * skip documentation.

Crea un’applicazione Sinatra di esempio che assomigli a "ciao mondo".

Once the server is ready, you can begin the load test. The call to ab looks like this:

Open another terminal and ssh back to the server. Test with ApacheBench. I used 1000 requests with a concurrency of 100. Don’t forget the final ’/’ for the path.

My results were about 300 requests per second. WEBrick is not known for his speed. Go ahead and end the server with Ctrl-c.

Install slim

Thin is a popular Ruby web server that uses Mongrel for analytics and EventMachine for non-blocking IO. Install slim and run the server again. Sinatra should automatically load Thin and let you know (“… backed up with Thin”).

Now try the load test again. It should be a little faster this time.

At least in this case, it appears that Thin provides a much faster server than WEBrick with over 700 requests per second (you can try to increase the total number of requests, but it wasn’t much higher for me).

Note: I was able to get 1000 requests per second on the Arch Linux droplet.

Application

Of course, these results do not reflect realistic server performance. HTTP is just one piece of the puzzle. A slow model engine and / or database will significantly reduce these numbers. However, it does provide a quick result for comparison.

Other performance tools you might be interested in:

  • HTTPperf
  • weight, etc.
  • https: //
  • siege
  • J meter
  • tourist bus

Last updated: November 9, 2020 References approved

This article was written by Brendon Rearick. Brendon Rearick is a personal trainer, strength coach, director of the fitness program and co-founder of Certified Functional Strength Coach (CSFC), a fitness education company in the San Francisco Bay Area. With 17 years of experience in the fitness industry, Brendon specializes in strength and conditioning training and his company CSFC has certified over 3,000 trainers in over 20 countries. Brendon worked as a Program Director at Mike Boyle Strength and Conditioning (MBSC) and obtained a massage license from the Cortiva Institute-Boston. Brendon holds a BS in Kinesiology from the University of Massachusetts, Amherst.

This article mentions 12 references that can be found at the bottom of the page.

wikiHow marks an article as Reader Approved when it receives enough positive feedback. In this case, 100% of readers who voted found the article helpful, thus earning Readers Approval status.

This article was viewed 238,603 times.

The abdominal rollers are very easy to use and can be surprisingly effective. If you stick to your routine, the abdominal roller will help you strengthen your abs and gradually improve flexibility. [1] X Research Source So what are you waiting for? All you need to get started is a comfortable, flat surface.

By Robert Qualls

Posted November 25, 2013.

introduction

Load testing is a good idea before any deployment. It’s nice to quickly establish a best-case scenario for a project before running more detailed tests down the road.

ApacheBench (ab) can load test servers by sending any number of concurrent requests. Although ab was designed to test Apache installations, it can be used to test any HTTP server.

In this tutorial we will see how the Ruby interpreter works with different servers under load. The tutorial steps assume a new Ubuntu 13.10 x32 image. The results were obtained with a droplet size of 512 MB.

Installation

Update the package database.

Install the apache2-utils package to access the ApacheBench.

User with limited privileges

Then create a user to manage Ruby. It’s not a good idea to run some of the commands in the next section as root.

What this command is for:

useradd – create a new user

-m – create a home directory

-d / home / test – sets the user’s home directory to / home / test

-s / bin / bash – sets the user’s shell default bash (Ubuntu uses a dash by default)

-g sudo – add a user to the sudo group (to execute commands from sudo)

test – name of the new user

Set a password for the new user.

Switch to the new user.

The Ruby version manager makes it easier to work with different Ruby environments. Manages the installation process of specific Ruby versions and the isolation of gems. It is currently installed by running a bash script from their website.

To use the rvm command, you must first run the rvm script.

If you want, you can insert it into yours. bashrc to make rvm available every time you log in as a user.

You can check if the rvm script is being used by checking the type header. It should be a function, not a hash.

Then install Ruby 2.0.0. RVM will ask for the user’s password because it needs to install an assortment of dependencies before it can make Ruby. Since RVM compiles Ruby from source, this step may take some time.

Switch to the new Ruby. This might happen by default after the installation, but checking doesn’t hurt.

Test

Now that Ruby is installed, you can create a simple site and see how many requests it can handle.

Install Sinatra. It’s a microframework/DSL for creating Ruby web applications. Flags – no – * skip documentation.

Crea un’applicazione Sinatra di esempio che assomigli a "ciao mondo".

Once the server is ready, you can begin the load test. The call to ab looks like this:

Open another terminal and ssh back to the server. Test with ApacheBench. I used 1000 requests with a concurrency of 100. Don’t forget the final ’/’ for the path.

My results were about 300 requests per second. WEBrick is not known for his speed. Go ahead and end the server with Ctrl-c.

Install slim

Thin is a popular Ruby web server that uses Mongrel for analytics and EventMachine for non-blocking IO. Install slim and run the server again. Sinatra should automatically load Thin and let you know (“… backed up with Thin”).

Now try the load test again. It should be a little faster this time.

At least in this case, it appears that Thin provides a much faster server than WEBrick with over 700 requests per second (you can try to increase the total number of requests, but it wasn’t much higher for me).

Note: I was able to get 1000 requests per second on the Arch Linux droplet.

Application

Of course, these results do not reflect realistic server performance. HTTP is just one piece of the puzzle. A slow model engine and / or database will significantly reduce these numbers. However, it does provide a quick result for comparison.

Other performance tools you might be interested in:

  • HTTPperf
  • weight, etc.
  • https: //
  • siege
  • J meter
  • tourist bus