You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2023/01/16 07:59:22 UTC

[Bug 66424] New: CPU affinity request

https://bz.apache.org/bugzilla/show_bug.cgi?id=66424

            Bug ID: 66424
           Summary: CPU affinity request
           Product: Apache httpd-2
           Version: 2.4.37
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: mpm_event
          Assignee: bugs@httpd.apache.org
          Reporter: machuang1983@gmail.com
  Target Milestone: ---

Created attachment 38463
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38463&action=edit
Diagram for cpu affinity setting

Hi All,

During httpd performance evaluation in Alibaba Cloud instance, I found httpd
performance improved significantly after using “taskset” to set CPU affinity
for httpd processes/threads, because it decreased the amount of CPU migrations.
Performance improved 60% in arm instance g8y.2xlarge(8 vcpus, 32GiB memory,
40GB ESSD), also improved 20% in x86 instance g7.2xlarge(8 vcpus, 32GiB memory,
40GB ESSD). Test case: run httpd with event mode on g8y.2xlarge or g7.2xlarge,
run traffic generator/benchmark 'wrk' on g8y.4xlarge(16 vcpus, 32GiB memory,
40GB ESSD), wrk command is 'wrk -t 32 -c 1000 -d 30 --latency http://$ServerIP'

mpm event parameters:
<IfModule mpm_event_module>
    StartServers              8
    ServerLimit             100
    ThreadLimit            2000
    MinSpareThreads          75
    MaxSpareThreads        2000
    ThreadsPerChild         125
    MaxRequestWorkers      2000
</IfModule>

But httpd didn't have related parameters to support CPU affinity, so I used
"taskset" to optimize. After source code analysis, I made a prototype for the
affinity solution(add set_affinity function when worker/lister thread created).
We can observed the same improvement by this solution. However, this prototype
only applied on above special “event mpm” configuration. I think also need to
modify current mechanism of dynamically adapts to the perceived load and add
new parameters for the affinity setting. 

So is it possible to involve httpd developer to evaluate this request and add
cpu affinity function in future version?

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66424] CPU affinity request

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66424

--- Comment #2 from Martin Ma <ma...@gmail.com> ---
Thanks Christophe, I had send the request and prototype code to dev mail list.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66424] CPU affinity request

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66424

--- Comment #1 from Christophe JAILLET <ch...@wanadoo.fr> ---
Hi,

with the numbers given, it looks like something interesting to look at.

If you want to share some code and start a discussion about it, the best would
be to do it via dedicated branch on github, or on our public @dev mailing list
(see https://httpd.apache.org/lists.html#http-dev)

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org