can you show some of the code?
I used to come into this problem when i slurped the entire file into a variable. Then spat it out all at once.
reading line by line with readline is a better method and outputing as you go helps as well. This gives the browser a much quicker response so it can start displaying data earlier.
this is a work around but may not be the direct answer you are looking for