haproxy nbproc and cpu-map config help

54 views
Skip to first unread message

Nicolas G

unread,
Aug 13, 2015, 7:49:20 AM8/13/15
to Ansible Project
Hi All,

I'm trying to deploy with Ansible an haproxy.cfg config that will automatically render to the bellow :

#/etc/haproxy.cfg 
"""
    nbproc 11

    cpu-map 1 0
    cpu-map 2 1
    cpu-map 3 2
    cpu-map 4 3
    cpu-map 5 4
    cpu-map 6 5
    cpu-map 7 6
    cpu-map 8 7
    cpu-map 9 8
    cpu-map 10 9
    cpu-map 11 10
"""

This will use all system CPU cores but leave 1 free to the operating system. I know I can use ansible_processor_vcpus
 fact to get the number of cores but I'm having trouble regarding the logic of the "cpu-map" lines..

Any ideas ? 

Regards,
N.
Reply all
Reply to author
Forward
0 new messages