Nginx - Google Summer of Code ideas

Valery Kholodkov valery+nginxen at grid.net.ru
Fri Mar 13 18:36:44 MSK 2009


----- "Maxim Dounin" <mdounin at mdounin.ru> wrote:

> > > other OSes have something too, but it's anyway will require some 
> > > non-trivial porting.
> > 
> > Here I disagree: linux kernel supports notification via eventfd
> since 2.6.18. eventfd syscall is available as of glibc 2.8, which is a
> part of e.g. ubuntu intrepid distribution. 
> > 
> > Personally I've tested this interface and it looks fine to me.
> 
> Disagree with what?  I've said there are interfaces, but they 
> aren't standard.  You've just added one more example of 
> non-standard interface.

I disagree that there is no good interface. I think they are all as best as they could be at the moment. After all kqueue notification of AIO completion isn't POSIX compliant.

> > > 2. It's usually implemented as a thread pool within OS kernel (at
> 
> > > least FreeBSD and Linux implementations AFAIK), and usually have 
> > > some limits administrator should be aware of (including maximum 
> > > number of io requests system may queue).
> > 
> > It is unclear whether kernel thread pool is a disadvantage or not. I
> don't think it is reasonable to use disk AIO as a primary mean to
> serve files, I think it won't make server faster than while using
> sendfile, but AIO could be serious boost for large out-of-cache files,
> because it eliminates blocking.
> > 
> > With such considerations kernel thread pool doesn't seem to be a big
> hassle.
> 
> Yes.  I've mentioned it just to show that AIO interface isn't 
> perfect and should be used with care.
>
> I actually think that AIO support in nginx would be really great.  
> I've just here to say that it's not trivial task.

I can imagine.

> 
> Maxim Dounin
> 
> p.s. As discussed some time ago on russian mailing list, probably 
> the best way will be to combine sendfile() with SF_NODISKIO and 
> AIO reading of 1 byte to place some file pages to cache (if 
> sendfile() returns EBUSY).  Just mentioning it here to make sure 
> this idea (Igor's one AFAIR) won't be lost if someone finally 
> start digging into AIO support.

I remember it.

-- 
Regards,
Valery Kholodkov





More information about the nginx mailing list