(E-Mail Removed) wrote:
> Hi,
>
> I've encountered a problem that i can't easily resolve, so i'd
> appreciate any help.
> I'm writing a HTTP proxy - the client (wget/browser) connects to a
> listening-socket, and the proxy passes the HTTP request to a
> webserver, then passing the reply from the webserver to the client.
>
> My proxy do NOT accumulate the data returned from the WebServer : i'm
> using epoll() , and each time my read() request is filled with data, i
> send the data to the other side and free the buffer .
What do you do if the send() blocks or otherwise doesn't succeed?
Robert
>
> Everything works great when both the client and the webserver running
> in the same network or using the same speed (100MB , 1GB) . however
> when the client is living in a low-speed network (10MB) and the
> webserver lives in a high-speed network (1GB) , i get performance
> problems due to swapping .
>
> My questions are practical and theoretical as well :
> 1. since i'm dealing with two different sockets (client socket+server
> socket) , how can i tell the server-socket to use the speed of the
> client-socket ? is it the Window-Size ?
> 2. since my process do not accumulate the memory , why do i see the
> memory gets bigger ? (top command), i would expect the kernel/machine
> to keep the memory, but not the process...
> 3. finally, how proxy usually deals with this problem ? i guess that
> i'm not the first one trying to connect two different networks with
> two statefull connections ...
>
> thank you very much
> zferentz
>