0

I am trying to serve PDF (useing tomcat server + Servlet normal streaming). The steaming is stable there is no bug and it handling parallel serving. But not as fast as Google DOC PDF Streaming.

My Question is how did they do that fast ?

What server they use (Apache + PHP)? or Python?

Please suggest which technology i can use to speed up the server that is as good as google.

(i know one main factor is good hardware configuration plus connectivity. my question is apart from that)

Niger
  • 3,916
  • 5
  • 30
  • 30
  • 2
    How have you tested your code? Is it slower than Google Docs when you run it from _local_ machine? If so, the problem is likely in your code - otherwise it's likely due to connectivity issues. Either way, there's no nearly enough information in your question to provide a reasonable answer. – ChssPly76 Aug 13 '09 at 01:53
  • Actually i followed buffering while serving. followed the code from http://stackoverflow.com/questions/55709/streaming-large-files-in-a-java-servlet – Niger Aug 13 '09 at 01:57
  • That doesn't answer my question. Does your code perform slower than Google Docs when you run it locally? I _REALLY_ doubt any significant speed difference can be caused by technology stack. – ChssPly76 Aug 13 '09 at 02:03
  • Nope locally its like reading from harddisk. We can see the difference only when it come from the server. – Niger Aug 13 '09 at 03:31

2 Answers2

1

Google is likely not generating the PDF on the fly. I am guessing that you are.

matt b
  • 138,234
  • 66
  • 282
  • 345
  • Right Matt. I am generating PDF on the fly. But im not considering the time for generating the PDF. I am considering the time when it start serving after PDF generation. I donno whats S3, Let me check S3 URL – Niger Aug 13 '09 at 03:33
  • Sorry I thought the question linked to above was asked by you. I removed the question about S3 from my answer. – matt b Aug 13 '09 at 12:33
0

They are probably using compression. Takes more CPU, but sends quite a bit less data over the wire - hence it gets to you faster.

Gandalf
  • 9,648
  • 8
  • 53
  • 88
  • Doesn't mean there is no compression - a modern multi-core CPU can do compression without breaking a sweat. You need to measure the # of bytes you receieve (or check the http headers in the response and see if Google docs is sending it compressed). – Gandalf Aug 14 '09 at 15:52