Guys,

I'm talking to the people from squid-dev mailing list about making Squid
log directly into MySQL.
Because Squid is a single-process application that does everything in
one select() loop, there are worried about blocking sockets: if you open
a socket from Squid to MySQL you don't want that socket to block, not
even for a second.
The long-term approach (that will make it into future versions of Squid)
is to use some sort of an external helper to consolidate all logging
stuff. But for the moment, if i want SQL logging in Squid-2.4, there's
this issue of blocking/non-blocking.

What is the answer to that (see message below)?

-----Forwarded Message-----

From: Robert Collins <[EMAIL PROTECTED]>
To: Florin Andrei <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: Re: MySQL logging
Date: 29 Jan 2002 19:44:47 +1100


----- Original Message -----
From: "Florin Andrei" <[EMAIL PROTECTED]>
> > > > If the socket is blocking, the call may still block. Does INSERT
DELAYED
> > > > work with non-blocking sockets?
> > >
> > > I have no idea. :o)
> >
> > Do it as an external process.
>
> Actually, "INSERT DELAYED" is designed to return success at once to
the
> client, no matter what happens; mysqld will cache the request and
> actually make it happen when enough resources are available (at once
if
> it's not too busy, later if other requests are eating up CPU and I/O).
> This option was specifically created for clients that cannot wait for
> busy servers to swallow their insert requests.
> That being said, is this still supposed to be an issue? (this is not
> very clear to me, that's why i'm asking)

Imagine the following scenario:
squid logs a lot of info.
the local socket buffer is filled, and the LAN to the SQL server is a
little congested (due to other traffic).
squid inserts yet another request, and squid blocks for 1/2 second.

That's a 1/2 second with no activity at all.

So, yes, it is an issue UNLESS the socket is able to be set non-blocking
(perhaps the mysql folk can answer this?).

Rob



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to