Re: mod_python.util.StorageField.read_to_boundary has problems in
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Re: mod_python.util.StorageField.read_to_boundary has problems in




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: mod_python.util.StorageField.read_to_boundary has problems in  
Mike Looijmans


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-08-05 10:56 PM

Alexis Marrero wrote:
> The next test that I will run this against will be with an obscene
> amount of data for which this improvement helps a lot!

The dumb thing is the checking for boundaries.

I'm using http "chunked" encoding to access a raw TAPE device through
HTTP with Python (it GETs or POSTs the raw data as body, each chunk
coresponds to a tape block). It blazes the data through at the max
network speed with hardly any CPU usage. This HTTP upload code uses 100%
CPU while running on my 3GHz box.

The looking-for-line-ends and mime boundaries method is very inefficient
compared to that. They oughta have put a "content-length" into every
chunk header, and we wouldn't have had this problem in the first place.

I think the only realistic way to improve performance is to read the
client input in binary chunks, and then looking for '\r\n---boundary'
strings in the chunk using standard string functions. Most of the CPU
time is now spent in the readline() call.

This also means revising all the mime body parsing to cope with that...
I doubt if that will be worth the effort for anyone.







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:25 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register