The Artima Developer Community
Sponsored Link

Python Buzz Forum
Slowly learning how to write a reverse proxy

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Phillip Pearson

Posts: 1083
Nickname: myelin
Registered: Aug, 2003

Phillip Pearson is a Python hacker from New Zealand
Slowly learning how to write a reverse proxy Posted: Jun 27, 2005 1:38 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Phillip Pearson.
Original Post: Slowly learning how to write a reverse proxy
Feed Title: Second p0st
Feed URL: http://www.myelin.co.nz/post/rss.xml
Feed Description: Tech notes and web hackery from the guy that brought you bzero, Python Community Server, the Blogging Ecosystem and the Internet Topic Exchange
Latest Python Buzz Posts
Latest Python Buzz Posts by Phillip Pearson
Latest Posts From Second p0st

Advertisement

OK, yesterday's reverse proxy was a success in that it took the load off Apache - Apache NEVER needs to spawn more than 5-6 servers any more, which is awesome.

However, it had some problems of its own:

1. If a client sent SOMETHING, but not a complete request, then stopped, it would never time out. So now it kills client connections that don't send anything for 60 seconds when they should be sending HTTP headers or POST data to the server.

2. If a client stopped RECEIVING, it would never time out. It seems that the clients timed themselves out, or the OS did something, though, so as well as an ever-growing list of "current" sessions inside the proxy, I ended up with the kernel keeping track of a lot of sockets in the CLOSE_WAIT state. So now it kills client connections that don't ack anything for 60 seconds.

Those two are OK now. The new problem is that it doesn't support HTTP keepalives, because I'm lazy, so I end up with thousands of sockets in the FIN_WAIT state(s). My server has a FIN_WAIT timeout of 60 seconds, which I hope will be good enough to keep this under control. Failing that, I'm going to have to get this thing to support persistent connections to the clients. I don't think I'll bother with keeping server connections persistent - I might as well just increase MinSpareClients in httpd.conf, as that will fix the main problem with that.

Fingers crossed now - let's see if it'll stay up for longer than 5 hours ...

Comment

Read: Slowly learning how to write a reverse proxy

Topic: python indentation found in strange places. Previous Topic   Next Topic Topic: Instant Messaging

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use