dean gaudet wrote:
[...]
>a mostly optimal syscall sequence for responses to a keep-alive
>connection on linux should look something like:
>
> sockfd = accept();
> fcntl(sockfd, F_SETFL, O_NDELAY)
> setsockopt(sockfd, TCP_CORK = 1)
> while (1) {
> rc = read(sockfd);
> if (rc <= 0) {
> save_errno = errno;
> /* send any remaining packets now */
> setsockopt(sockfd, TCP_CORK = 0);
> if (rc == 0) break;
> if (save_errno == EAGAIN) {
> poll(until we can read sockfd);
> continue;
> }
> /* log error */
> break;
> }
> /* parse request */
> respfd = open(response_file);
> write(sockfd, response headers)
> sendfile(sockfd, respfd)
> close(respfd)
> }
> close(sockfd);
>
The current 2.0 httpd does basically this, except that it resets the
TCP_CORK and TCP_NODELAY flags (to 'off' and 'on,' respectively)
after each sendfile call (rather than just when it gets EAGAIN on a
read). This seems like a bug. Is there some context in which the resetting
of these flags after every sendfile call is really necessary?
--Brian
- Re: mod_file_cache performa... dean gaudet
- Re: mod_file_cache performa... dean gaudet
- Re: mod_file_cache performa... Victor J. Orlikowski
- Re: mod_file_cache performa... Sander van Zoest
- Re: mod_file_cache performa... dean gaudet
- Re: mod_file_cache performa... Cliff Woolley
- Re: mod_file_cache performa... Bill Stoddard
- Re: mod_file_cache performa... dean gaudet
- Re: mod_file_cache performa... Bill Stoddard
- Re: mod_file_cache performa... rbb
- Re: mod_file_cache performa... Brian Pane
- Re: mod_file_cache performa... dean gaudet
- Re: mod_file_cache performa... Jeff Trawick
- Re: mod_file_cache performa... dean gaudet
- Re: mod_file_cache performance dean gaudet
- Re: mod_file_cache performance Ian Holsman
- Re: mod_file_cache performance Cliff Woolley
- RE: mod_file_cache performance Gonyou, Austin
- RE: mod_file_cache performance Cliff Woolley
- RE: mod_file_cache performance Gonyou, Austin
- RE: mod_file_cache performance Gonyou, Austin
