[Cherokee] Strange issue with threads

11 views
Skip to first unread message

Jaime Bozza

unread,
Jun 19, 2009, 6:29:41 PM6/19/09
to cher...@lists.alobbs.com

Another day, another issue.  In testing my new FreeBSD port, I’ve had to start and restart the server several times.   I noticed that the server was taking a long time to stop.  It didn’t matter if it was a hard restart or a graceful restart.

 

After turning on tracing, I found that pthread_join() was taking several seconds to stop some of the threads.

 

My question – Has anyone else noticed slowness (in the order of over 5-10 seconds and more!) when restarting Cherokee?   During this time, all IO is blocked, so nothing can be served, which is a bit of a problem.   While restarting rarely happens, it makes it difficult for making quick changes.

 

I’m trying to figure out if it’s just something with FreeBSD or if it’s happening with other OS’s as well, so input from anyone is welcome.

 

Jaime

 

 

Pablo Hernan Saro

unread,
Jun 19, 2009, 7:38:59 PM6/19/09
to Jaime Bozza, cher...@lists.alobbs.com
I'm using Cherokee in slackware, compiling it my way. I've tested it
with no considerable load and I've never experienced such problem.
If you can send me your port in private I'll look if this happens to
me (I have a FreeBSD box).
Cheers

Pablo

On 6/19/09, Jaime Bozza <jbo...@mindsites.com> wrote:
> Another day, another issue. In testing my new FreeBSD port, I've had to
> start and restart the server several times. I noticed that the server was
> taking a long time to stop. It didn't matter if it was a hard restart or a
> graceful restart.
>
> After turning on tracing, I found that pthread_join() was taking several
> seconds to stop some of the threads.
>

> My question - Has anyone else noticed slowness (in the order of over 5-10


> seconds and more!) when restarting Cherokee? During this time, all IO is
> blocked, so nothing can be served, which is a bit of a problem. While
> restarting rarely happens, it makes it difficult for making quick changes.
>
> I'm trying to figure out if it's just something with FreeBSD or if it's
> happening with other OS's as well, so input from anyone is welcome.
>
> Jaime
>
>
>

--
Sent from Gmail for mobile | mobile.google.com
_______________________________________________
Cherokee mailing list
Cher...@lists.octality.com
http://lists.octality.com/listinfo/cherokee

Alvaro Lopez Ortega

unread,
Jun 20, 2009, 9:05:04 AM6/20/09
to Jaime Bozza, cher...@lists.alobbs.com

I haven't noticed such behavior in any modern version.

Which version are you running?

--
Octality
http://www.octality.com/

Jason

unread,
Jun 20, 2009, 1:55:33 PM6/20/09
to cher...@lists.alobbs.com
Jaime Bozza <jbozza <at> mindsites.com> writes:

> My question – Has anyone else noticed slowness (in the
> order of over 5-10 seconds and more!) when restarting Cherokee?   During this
> time, all IO is blocked, so nothing can be served, which is a bit of a
> problem.   While restarting rarely happens, it makes it difficult for making
> quick changes.

I'll post my observations here as well.

In reading your post about issue with threads I watched my server restart more
closely. I guess it does actually take a little bit of time to kill the process.
It looks like this for example:

Stopping cherokee.
Waiting for PIDS: 38173, 38173, 38173, 38173, 38173.

It's always the list of 5 PIDS. I've always assumed it just waiting for the
5 php-cgi child processes to die. So I tried a restart immediately after the
server was restarted, and before any php-cgi processes were started, and it's
actually the same thing, the 5 repeated PIDS before it's done. Without looking
at a watch I counted about 6 or 7 seconds before it was complete. Startup on the
other hand is next to instantaneous.

This is also on FreeBSD. FreeBSD 7.2-RELEASE-p1.

I also have cherokee 0.99.17 (from the "sid" repository) running on my Debian
5.01 (Mostly Lenny, some mixed packages) server at home. I watched the restart
on it, and it is definitely faster. Maybe 2-3 seconds before the process stops
and then the same near instantaneous startup.

Hope that is useful information.

Jason

Pablo Hernan Saro

unread,
Jun 20, 2009, 8:53:19 PM6/20/09
to cher...@lists.alobbs.com
Hi Jaime,

I hope you're doing fine.
I just tested cherokee on FreeBSD 7.2-STABLE running on a i386 box. I installed your port just out of the box and configured a virtual host with PHP as FastCGI, everything by default (in fact, I've used the wizard). Good news: after opening several http sessions requesting php files, I performed a hard restart and it tooks 2 seconds. Then I tried a graceful restart and it tooks a couple additional seconds because of the gracefulness.
I'm also running cherokee on Linux, so I compared both. To be honest, there is no visible difference.
Well, I hope it helps. Let me know if I can help you further.
Cheers

Pablo

On Fri, Jun 19, 2009 at 9:31 PM, Pablo Hernan Saro <pabl...@gmail.com> wrote:
Hi Jaime,

Thanks for sharing your port. I'll look into it over the weekend. My box is for testing purposes and runs 7.2-STABLE x86. I'll let you know as soon as test it.
Cheers

Pablo


On Fri, Jun 19, 2009 at 9:01 PM, Jaime Bozza <jbo...@mindsites.com> wrote:
Pablo,

Attached is the port.  I'm using 7.2-STABLE Amd64.  I'm starting Cherokee just with the default config, but I'm keeping it in the foreground so I can see what's happening.  Using Cherokee-Admin and doing a graceful restart causing the Cherokee process to immediately show that it received the graceful restart, but for several seconds it sits there before bringing up the information banner (showing that the process restarted) again.

Load while Cherokee is running doesn't seem to be an issue - Just the restart.

Thanks for your help!

Jaime

Alvaro Lopez Ortega

unread,
Jun 21, 2009, 2:27:43 PM6/21/09
to Jason, cher...@lists.alobbs.com
On 20-jun-09, at 19:55, Jason wrote:

> It's always the list of 5 PIDS. I've always assumed it just waiting
> for the
> 5 php-cgi child processes to die. So I tried a restart immediately
> after the
> server was restarted, and before any php-cgi processes were started,
> and it's
> actually the same thing, the 5 repeated PIDS before it's done.
> Without looking
> at a watch I counted about 6 or 7 seconds before it was complete.
> Startup on the
> other hand is next to instantaneous.
>
> This is also on FreeBSD. FreeBSD 7.2-RELEASE-p1.
>
> I also have cherokee 0.99.17 (from the "sid" repository) running on
> my Debian
> 5.01 (Mostly Lenny, some mixed packages) server at home. I watched
> the restart
> on it, and it is definitely faster. Maybe 2-3 seconds before the
> process stops
> and then the same near instantaneous startup.


I've tested it on Linux and MacOS X. In both cases it restarted in a
fairly acceptable time.

Anyway, it sounds like something worth checking (at least on FreeBSD).
Could you please log a bug for it so we ensure it's in the to-do list?

http://bugs.cherokee-project.com/

Thanks!

--
Octality
http://www.octality.com/

Jason

unread,
Jun 21, 2009, 6:07:17 PM6/21/09
to cher...@lists.alobbs.com
Alvaro Lopez Ortega <alvaro <at> alobbs.com> writes:

> Anyway, it sounds like something worth checking (at least on FreeBSD).
> Could you please log a bug for it so we ensure it's in the to-do list?
>
> http://bugs.cherokee-project.com/
>
> Thanks!

Done! ID #500!

Thanks,
Jason

Jaime Bozza

unread,
Jun 22, 2009, 9:42:41 AM6/22/09
to Alvaro Lopez Ortega, cher...@lists.alobbs.com
> > My question - Has anyone else noticed slowness (in the order of over

> > 5-10 seconds and more!) when restarting Cherokee? During this
> > time, all IO is blocked, so nothing can be served, which is a bit of
> > a problem. While restarting rarely happens, it makes it difficult
> > for making quick changes.
> >
> > I'm trying to figure out if it's just something with FreeBSD or if
> > it's happening with other OS's as well, so input from anyone is
> > welcome.
>
> I haven't noticed such behavior in any modern version.
>
> Which version are you running?

0.99.17 - Just updated to 0.99.18 to see if the results are the same. System is a newly built Quad Core (Intel) with FreeBSD 7.2-STABLE 64-bit.

Similar results on 7.2-STABLE 32-bit, though not as long.

I see that Jason has already published a bug, so I'll post my trace results there.

Jaime

Jaime Bozza

unread,
Jun 22, 2009, 10:10:51 AM6/22/09
to Pablo Hernan Saro, cher...@lists.alobbs.com

Pablo,

 

Can you try the following?

 

1)      Install Cherokee using the default cherokee.conf file.  This just serves up the default cherokee page.

2)      Start the server using the FreeBSD RC script

3)      Wait a minute, restart the server using /usr/local/etc/rc.d/cherokee restart

4)      Observe the number of times the system is “Waiting for PIDS”

 

Typically, it shouldn’t have to wait hardly at all.

 

It’s possible that adding PHP to the mix may “fix” the issue, which I’ll test in a little bit, but I’ve just been testing core functionality first.

 

Jaime

Pablo Hernan Saro

unread,
Jun 22, 2009, 5:02:24 PM6/22/09
to Jaime Bozza, cher...@lists.alobbs.com
Hello Jaime,

I followed your instructions carefully and got the same result. I got only one time the message "Waiting for PIDS" and the restart took just a couple of seconds.
I don't see any problem on this...
Hope it helps. Don't hesitate to contact me for further testing.

Pablo

Jaime Bozza

unread,
Jun 22, 2009, 6:10:18 PM6/22/09
to Pablo Hernan Saro, cher...@lists.alobbs.com

Pablo,

 

One last question – Are you operating under an SMP kernel or is it just a single core processor?

Reply all
Reply to author
Forward
0 new messages