On Mon, Jul 13, 2009 at 03:02:04PM -0700, Dan Price wrote: > Interesting. Apache also has a timeout definition but it is quite > different. (Note that the apache 2.2 docs are totally wrong about that > definition, it is fixed in the trunk): > > "The TimeOut directive defines the length of time Apache will wait for I/O > in > various circumstances: > > 1. When reading data from the client, the length of time to wait for a > TCP packet to arrive if the read buffer is empty. > 2. When writing data to the client, the length of time to wait for > an acknowledgement of a packet if the send buffer is full. > 3. In mod_cgi, the length of time to wait for output from a CGI script. > 4. In mod_ext_filter, the length of time to wait for output from a > filtering process. > 5. In mod_proxy, the default timeout value if ProxyTimeout is not > configured. > > This seems a little more sane for the sort of work we're doing than > the libcurl definition. > > Would it be possible to keep resetting libcurl's conn timeout whenever > new data arrives? This would mimic the behaviour we'd probably like. > > I guess another idea would be to just set the timeout with the expected > xfer size in mind.
I'm hesitant to make a value judgment about whose approach is better for timeouts. Certainly Apache and Python take a more systems-programming-oritented approach to dealing with the timeouts. Libcurl seems to think of the entire transaction as the interesting portion to time. I'm honestly more used to the former, but there must be some folks who make use of the latter approach. Libcurl has a LOW_SPEED_LIMIT and LOW_SPEED_TIME option. These allow us to configure a minimum speed for the client. If it remains below the speed limit for the designated amount of time, the client gives up and times out. If you have multiple hosts configured for a publisher, this would cause you to choose another, hopefully faster host. (Stephen and I are working on some better metrics than what we have right now...) I also filed bug 10010 for this issue. I'm inclined to use the low speed options, since the low speed test is a more general case of the stalled connection. -j _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
