mod_perl with epoll

mod_perl with epoll

am 04.12.2010 16:16:36 von Practical Perl

Hi list,

Apache 2.2 supports the epoll event driver.
Does epoll have any performance improvement to mod_perl application?

Thanks.

Re: mod_perl with epoll

am 04.12.2010 17:32:30 von torsten.foertsch

On Saturday, December 04, 2010 16:16:36 Xiao Lan wrote:
> Apache 2.2 supports the epoll event driver.
> Does epoll have any performance improvement to mod_perl application?

I believe you are not asking whether epoll as a device for waiting for=20
requests can improve your application since epoll is used even in my prefor=
k=20
environment:

$ strace -p 26570
Process 26570 attached - interrupt to quit
semop(7766017, {{0, -1, SEM_UNDO}}, 1) =3D 0
epoll_wait(14, {{EPOLLIN, {u32=3D24080208, u64=3D24080208}}}, 6, 10000) =3D=
1
accept4(4, {sa_family=3DAF_INET, sin_port=3Dhtons(59505),=20
sin_addr=3Dinet_addr("127.0.0.1")}, [16], SOCK_CLOEXEC) =3D 15
semop(7766017, {{0, 1, SEM_UNDO}}, 1) =3D 0
..

I rather think you are asking if an event driven or thread based MPM (like =
the=20
event-MPM) can improve your application.

I doubt it. Here are a few thoughts:

=2D Modperl in a threaded environment is still quite unstable. Be prepared =
for=20
segfaults.

=2D In a threaded environment one process uses multiple copies of the perl=
=20
interpreter. That means that RAM that in a multi-process environment can be=
=20
shared by copy-on-write will be allocated to every single interpreter. Henc=
e,=20
apache becomes a memory hog this way.

=2D Further, perl itself if compiled without threads is noticeable faster.

=2D modperl applications normally spend much time in waiting for databases =
and=20
generating documents dynamically. So a possible gain from a sightly faster=
=20
context switch would hardly be noticeable.

Also, you have to define "performance improvement" more thoroughly:

=2D do you want to save CPU cycles per request?

=2D do you want to shorten the time the user has to wait for the answer?

=2D do you want to maximize the number of concurrent requests your server i=
s=20
able to digest?

Certainly there are more aspects to consider.

Torsten Förtsch

=2D-=20
Need professional modperl support? Hire me! (http://foertsch.name)

Like fantasy? http://kabatinte.net

Re: mod_perl with epoll

am 05.12.2010 03:23:09 von Practical Perl

2010/12/5 Torsten Förtsch :

> I rather think you are asking if an event driven or thread based MPM (lik=
e the
> event-MPM) can improve your application.
>

Thanks Torsten.

Yep, I did mean if the event driven MPM as event-MPM can improve the
performance of modperl application.
For threads I never used it under modperl.

Regards.