On 02/11/2013 04:30 AM, Eliezer Croitoru wrote:
>>> I noticed another issue regarding squid with kids process:
>>> when used with two cache_dirs(rock+aufs) it uses two kids, is it
>>> suppose to be like that?
>> Yes Squid splits into a Disker kid which manages all the disk I/O
>> processes and a Worker which handles all the HTTP proxying and most
>> other tasks.
For the record, to avoid any confusion if somebody reads this without
reading documentation, it is one disker kid per Rock cache_dir, not one
disker kid for all disk I/O. There are more caveats discussed below.
> Which I think should be mentioned in a way at the docs of cache_dir
> directive which I couldn't understand from.
> It's not mentioned that multi cache_dir directives make squid to a SMP
> service rather then one process service.
I think this depends on what you mean by "SMP service". Even without
Rock, Squid creates other processes and/or threads, especially in daemon
mode, so you must give disker more weight than those other
processes/threads if you think the situation with Rock is special. Note
that disker kids do not accept HTTP requests (they are not Workers).
The issue is further complicated by the fact that when run in non-daemon
mode or when forced to use a non-Ipc disk I/O module, Rock cache_dir may
not create diskers at all. This is why "squid -N" still "works" even if
you use Rock cache_dir. Here is the corresponding code:
> bool
> Rock::SwapDir::needsDiskStrand() const
> {
> const bool wontEvenWorkWithoutDisker = Config.workers > 1;
> const bool wouldWorkBetterWithDisker = DiskIOModule::Find("IpcIo");
> return InDaemonMode() && (wontEvenWorkWithoutDisker ||
> wouldWorkBetterWithDisker);
> }
I agree that squid.conf.documented can be improved in this area. I added
the following paragraph to cache_dir rock description (trunk r12671):
> If possible, Squid using Rock Store creates a dedicated kid
> process called "disker" to avoid blocking Squid worker(s) on disk
> I/O. One disker kid is created for each rock cache_dir. Diskers
> are created only when Squid, running in daemon mode, has support
> for the IpcIo disk I/O module.
As you can tell, the above does not tell the whole story (told by the
actual code quoted above), but I hope it is better than nothing. Further
improvements welcome! However, if you respond to this, please start a
new email thread.
Thank you,
Alex.
Received on Mon Feb 11 2013 - 21:34:38 MST
This archive was generated by hypermail 2.2.0 : Tue Feb 12 2013 - 12:00:12 MST