tech:ulimit
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:ulimit [2025/05/14 03:45] – Jean-Baptiste | tech:ulimit [2025/09/01 16:14] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| {{tag> | {{tag> | ||
| - | = ulimit | + | # ulimit |
| Voir aussi : | Voir aussi : | ||
| Ligne 8: | Ligne 9: | ||
| Depuis Redhat 6 nous avons : | Depuis Redhat 6 nous avons : | ||
| - | <code - / | + | '' |
| + | ~~~ | ||
| # Default limit for number of user's processes to prevent | # Default limit for number of user's processes to prevent | ||
| # accidental fork bombs. | # accidental fork bombs. | ||
| Ligne 15: | Ligne 17: | ||
| root | root | ||
| www-data | www-data | ||
| - | </ | + | ~~~ |
| Options ulimit : | Options ulimit : | ||
| Ligne 24: | Ligne 26: | ||
| * -u : Nombre maximal de processus utilisateurs | * -u : Nombre maximal de processus utilisateurs | ||
| - | < | + | ~~~bash |
| ulimit -a -H | ulimit -a -H | ||
| ulimit -a -S | ulimit -a -S | ||
| - | </ | + | ~~~ |
| - | < | + | ~~~bash |
| help ulimit | help ulimit | ||
| - | </ | + | ~~~ |
| - | Voir [[http:// | + | Voir <http:// |
| - | < | + | ~~~bash |
| :(){ :|:& };: | :(){ :|:& };: | ||
| - | </ | + | ~~~ |
| Ligne 47: | Ligne 49: | ||
| Pourquoi ne pas utiliser les cgroups ? | Pourquoi ne pas utiliser les cgroups ? | ||
| - | == Core dump | + | ## Core dump |
| Désactiver les cores dumps (Redhat) | Désactiver les cores dumps (Redhat) | ||
| - | <code bash / | + | |
| + | '' | ||
| + | ~~~bash | ||
| # No core files by default | # No core files by default | ||
| ulimit -S -c 0 > /dev/null 2>&1 | ulimit -S -c 0 > /dev/null 2>&1 | ||
| - | </ | + | ~~~ |
| Activer les cores dumps (Redhat) | Activer les cores dumps (Redhat) | ||
| - | < | + | ~~~bash |
| su - | su - | ||
| ulimit -c unlimited | ulimit -c unlimited | ||
| - | </ | + | ~~~ |
| - | == Notes | ||
| - | < | + | ## Notes |
| + | |||
| + | ~~~bash | ||
| /bin/bash -c ulimit -S -c 0 >/ | /bin/bash -c ulimit -S -c 0 >/ | ||
| - | </ | + | ~~~ |
| - | === Temps réel | + | ### Temps réel |
| However, for systems with a Linux kernel 2.6.13 or newer, it is possible to allow processes without root privileges to set the real-time scheduling policy. | However, for systems with a Linux kernel 2.6.13 or newer, it is possible to allow processes without root privileges to set the real-time scheduling policy. | ||
| Ligne 73: | Ligne 78: | ||
| For example, adding the line | For example, adding the line | ||
| - | <code -> | + | ~~~ |
| | | ||
| - | </ | + | ~~~ |
| - | == Outils | ||
| + | ## Outils | ||
| Appliquez les modifications directement à un processus en cours d' | Appliquez les modifications directement à un processus en cours d' | ||
| + | |||
| + | ## Python | ||
| + | |||
| + | ~~~python | ||
| + | import resource | ||
| + | |||
| + | print(resource.getrlimit(resource.RLIMIT_NOFILE)[1]) | ||
| + | ~~~ | ||
tech/ulimit.1747187143.txt.gz · Dernière modification : de Jean-Baptiste
