On 11/08/2009 12:53 AM, ios firefox wrote:
1. is TS's works asynchronous, like lighttpd?
or it works synchronous, one thread serves one request, when all the threads in the pool exhausts, then refuse to work?

Both. There are <x> number of worker threads (net-threads), by default we create 2.5 threads per core (CPU). This is configurable in records.config. Within each worker thread, it's asynchronous like lighttpd or squid (each thread has event driven state machines). This is what makes TS scale well, there's no thread pool exhaustion like Varnish, there's no single thread like Squid.

2. Can "Congestion Control" be used in revers proxy mode, when congestion happend, return the user a user-defined page?

Congestion control is something we didn't use at Yahoo, and the code is untested at a minimum, and maybe even missing partially (I think the congestion control stuff depends on the ARM module, which we removed). If someone is interested in working on this, we'd be more than happy to help you get started, but it'd have to be owned by a group of people that cares for it. We'll also have to figure what, if any, additional code we'll have to opensource.

3. I am trying to find the command to delete certain cache object by regex. But I only find the method which delete the total database. is there a method to only delete certain object ?

This is the cache inspector. The documentation for this might be a little wonky, and it used to only work with IE. But we made some changes to this feature a while ago, where you can actually set it up in reverse proxy mode (that avoids the issue of having to point your browser to it as the forward proxy). In order to use the cache inspector, you have to allow it, in records.config you'll have:

    CONFIG proxy.config.http_ui_enabled INT 1


If I recall, you can setup a remap.config rule like this if you want to use it in reverse proxy mode:

   map http://yourmachinename.com/cacheinspector  http://{cache}

(remember that yourmachinename.com can be anything, as long as the requests Host: header matches that).


Now, this would allow it from anywhere, so you might want to put an ACL on that in either remap.config, e.g.

map http://yourmachinename.com/cacheinspector http://{cache} @action=allow @src_ip=10.0.0.0-10.255.255.255

Or use regular acl's (which are slow). Alternatively, you could bind a second port, which is firewalled off from the the world, but allowed from inside. E.g.

    CONFIG proxy.config.http.server_other_ports STRING 81:X


And then change the map rule accordingly, e.g.

    map http://yourmachinename.com:81/cacheinspector  http://{cache}

(this would be my personal choice since it's easy to manage this once and for all in a firewall ACL).


Cache inspection is very expensive if you have a very large cache, and as far as I know, is only exposed via this type of GUI. It'd be useful to make some generic interface for this from command line, so that it could more easily be scripted. Patches are appreciated (but file Jira tickets first :).

Cheers,

-- leif

Reply via email to