Closed Bug 694221 Opened 13 years ago Closed 6 years ago

Sync server no longer streams application/newlines data

Categories

(Cloud Services Graveyard :: Server: Sync, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: telliott, Assigned: rfkelly)

Details

(Whiteboard: [php regression][qa-][sync-scale])

On queries for particularly large sets of ids, when application/newlines was being used, we'd stream the data as we got it back from the database. This meant that the data would start arriving at the user faster, preventing some timeouts. 

Now, we marshal all the data before shipping it off, no matter what the format. Can our wsgi model support streaming responses?
Whiteboard: [php regression] → [php regression][qa?]
Assignee: nobody → rkelly
Whiteboard: [php regression][qa?] → [php regression][qa-]
Whiteboard: [php regression][qa-] → [php regression][qa-][sync-scale]
Reviving this bug a we think streaming may help us with current server load issues.  Some notes for myself:

  * PyMySQL supports an "SSCursor" class for streaming the results out of MySQL.  It's unclear how difficult this will be to use with sqlalchemy.
  * Gunicorn appears to correctly translate generator-based output into a chunked encoding respose.
  * nginx may need some tweaking to avoid buffering the output at that layer as well ("proxy_buffering off" or similar?)
  * not clear yet how much of baseapp assumes a buffered response...

Should we do this only for application/newlines, or for JSON output as well?  It seems simple enough to emit the leading "{" and trailing "}" as separate chunks, streaming all the things in the middle.
we should definitely do this for json. it's just a matter of putting {} around it, adding a comma before everything but the first one and json-outputting each record.
Closing out this ancient bug
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Product: Cloud Services → Cloud Services Graveyard
You need to log in before you can comment on or make changes to this bug.