Welcome! Log In Create A New Profile

Advanced

Re: Breaking content generation phase into multiple phases or adding custom events in content phase

Jeff Kaufman
June 19, 2015 08:36AM
The two other things that ngx_pagespeed needs to use OS threads for:

* image optimization: blocking the nginx event loop to recompress
large images gives you very visible stalls

* background optimization: we want to return whatever we have to the
user, and then go on optimizing resources this request referenced in
the background

But yes, this (and parsing all the html as it flows through) does keep
you from hitting C10K. I'm currently playing with some designs for a
lighter version of PageSpeed that drops optimizations that can't be
implemented efficiently or 100% safely, and I think it should be able
to support nearly as many clients as standard nginx. It would still
use a background thread for image optimization, though.

On Thu, Jun 18, 2015 at 11:06 PM, Yichun Zhang (agentzh)
<agentzh@gmail.com> wrote:
> Hello!
>
> On Thu, Jun 18, 2015 at 7:06 PM, Jeff Kaufman wrote:
>> ngx_pagespeed does this by giving nginx a pipe to watch, setting up a
>> handler for that pipe, calling an async api that uses threads, then
>> the from the callback writing a byte to the pipe. Now when the async
>> code finishes we're back on the nginx event loop in the pipe's
>> handler.
>>
>
> Extra OS threads add their own complexity and overhead (killing C10K,
> for example), which I think we should avoid wherever we can (well,
> disk I/O cannot be nonblocking and we should only use thread pools for
> that).
>
> Well, just my 2 cents.
>
> Regards,
> -agentzh
>
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Breaking content generation phase into multiple phases or adding custom events in content phase

Kaustubh Deorukhkar 750 June 17, 2015 02:18PM

Re: Breaking content generation phase into multiple phases or adding custom events in content phase

Yichun Zhang (agentzh) 359 June 17, 2015 11:28PM

Re: Breaking content generation phase into multiple phases or adding custom events in content phase

Jeff Kaufman 613 June 18, 2015 07:08AM

Re: Breaking content generation phase into multiple phases or adding custom events in content phase

Yichun Zhang (agentzh) 344 June 18, 2015 11:08PM

Re: Breaking content generation phase into multiple phases or adding custom events in content phase

Jeff Kaufman 387 June 19, 2015 08:36AM

Re: Re: Breaking content generation phase into multiple phases or adding custom events in content phase

kaustubh 465 June 24, 2015 12:02AM

Re: Breaking content generation phase into multiple phases or adding custom events in content phase

kaustubh 447 June 22, 2015 02:20AM

Re: Breaking content generation phase into multiple phases or adding custom events in content phase

Jeff Kaufman 390 June 23, 2015 05:58AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 103
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready