mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-08 21:34:25 +00:00
feat: introduce apachebench
This commit is contained in:
70
knowledge base/ab.md
Normal file
70
knowledge base/ab.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# Apache HTTP server benchmarking tool
|
||||
|
||||
> TODO
|
||||
|
||||
Intro
|
||||
|
||||
<!-- Remove this line to uncomment if used
|
||||
## Table of contents <!-- omit in toc -->
|
||||
|
||||
1. [TL;DR](#tldr)
|
||||
1. [Further readings](#further-readings)
|
||||
1. [Sources](#sources)
|
||||
|
||||
## TL;DR
|
||||
|
||||
<details>
|
||||
<summary>Setup</summary>
|
||||
|
||||
```sh
|
||||
apt install 'apache2-utils'
|
||||
dnf install 'httpd-tools'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Usage</summary>
|
||||
|
||||
```sh
|
||||
# Limited number of requests
|
||||
ab -n '750' -c '1' 'http://grafana.example.org/'
|
||||
|
||||
# Sustained load for 't' seconds
|
||||
# Default requests limit is 50000
|
||||
ab -t 300 -c 100 http://192.168.29.20/
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<!-- Uncomment if used
|
||||
<details>
|
||||
<summary>Real world use cases</summary>
|
||||
|
||||
```sh
|
||||
```
|
||||
|
||||
</details>
|
||||
-->
|
||||
|
||||
## Further readings
|
||||
|
||||
- [Website]
|
||||
|
||||
### Sources
|
||||
|
||||
- [Load Testing in Linux With ApacheBench (ab)]
|
||||
|
||||
<!--
|
||||
Reference
|
||||
═╬═Time══
|
||||
-->
|
||||
|
||||
<!-- In-article sections -->
|
||||
<!-- Knowledge base -->
|
||||
<!-- Files -->
|
||||
<!-- Upstream -->
|
||||
[website]: https://httpd.apache.org/docs/current/programs/ab.html
|
||||
|
||||
<!-- Others -->
|
||||
[load testing in linux with apachebench (ab)]: https://www.baeldung.com/linux/ab-apachebench-load-testing
|
||||
10
snippets/ab.fish
Normal file
10
snippets/ab.fish
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# Install
|
||||
apt install 'apache2-utils'
|
||||
dnf install 'httpd-tools'
|
||||
|
||||
ab -n '750' -c '1' 'http://grafana.example.org/'
|
||||
ab -t 100 -c 250 -C 'GITLAB_TOKEN=0123…' 'https://gitlab.example.org/'
|
||||
|
||||
parallel ab -t 40 -c 100 -C 'GITLAB_TOKEN=1234…' {} ::: https://gitlab.{production,staging}.example.org/
|
||||
@@ -26,3 +26,6 @@ curl --url 'https://gitlab.com/api/v4/runners/all' \
|
||||
curl -fsX 'PUT' 'https://gitlab.com/api/v4/runners/{}' -H 'PRIVATE-TOKEN: glpat-m-…' -F 'paused=true'
|
||||
curl --fail --silent --request 'PUT' 'https://gitlab.com/api/v4/runners/{}' \
|
||||
--header 'PRIVATE-TOKEN: glpat-m-…' --form 'paused=true'
|
||||
|
||||
|
||||
curl -v --cookie "USER_TOKEN=Yes" http://127.0.0.1:5000/
|
||||
|
||||
Reference in New Issue
Block a user