|
Rank: Newbie Groups: Member
Joined: 11/6/2013 Posts: 5
|
we deployed eo.pdf 2013 & eo.web 2013 to the client servers for generating pdf from aspx page and found out that it takes from 2-3 minutes to get the response back whether you run it from a remote browser via internet or locally on the machine; but If I run it on our development machine locally, it runs very quick (less than 20 seconds). I already read http://www.essentialobjects.com/doc/4/web/aspxtopdf.aspx and I have also setup the hosts file on the server to resolve to the internal ip. It works, just very slow. I ran wireshark and this is the relevant network communication after clicking the generate pdf button and doing postback. No. Timestamp source destination protocol length info Time DestPort SourcePort 191 4.926483000 10.28.102.10 10.28.102.70 HTTP 720 POST /somefolder/xyz.aspx?id=2 HTTP/1.1 (application/x-www-form-urlencoded) 12:10:45.794382000 8070 58052 720 192 4.926498000 10.28.102.70 10.28.102.10 TCP 54 8070 > 58052 [ACK] Seq=4329 Ack=2804 Win=256 Len=0 12:10:45.794397000 58052 8070 1079 35.886031000 10.28.102.70 10.28.102.10 TCP 54 8070 > 58051 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0 12:11:16.753930000 58051 8070 1496 55.887196000 10.28.102.70 10.28.102.10 TCP 54 8070 > 58053 [RST, ACK] Seq=244 Ack=1099 Win=0 Len=0 12:11:36.755095000 58053 8070 3278 133.804484000 10.28.102.10 10.28.102.70 TCP 60 58052 > 8070 [ACK] Seq=2804 Ack=7249 Win=12598 Len=0 12:12:54.672383000 8070 58052 3279 133.804485000 10.28.102.10 10.28.102.70 TCP 60 58052 > 8070 [ACK] Seq=2804 Ack=10169 Win=15518 Len=0 12:12:54.672384000 8070 58052 ...... ...... ....... 3456 134.446447000 10.28.102.10 10.28.102.70 TCP 60 58052 > 8070 [ACK] Seq=2804 Ack=389769 Win=13140 Len=0 12:12:55.314346000 8070 58052 3457 134.446464000 10.28.102.70 10.28.102.10 HTTP 10204 HTTP/1.1 200 OK (application/pdf) 12:12:55.314363000 58052 8070 You can see from the time, the fist couple of ack, rst,ack takes a while and the response does not start coming in until timestamp column value 133.8. it doesn't really pinpoint any issues. Is there anything else I can look in wireshark capture that would be sent by eo.pdf? thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
Please try to create a test page with nothing in it, then run ASPXToPDF and see if it is still slow. If that runs fast, then it has to do with contents in your page, for example, an image in your page. Unlike a browser that would display the HTML as soon as it receives them, our converter would try to wait until all the dependency resources (images, script) are loaded since it doesn't want to convert an incomplete page. So it is possible that one small image or script can slow down the whole conversion. If that's the case, try to identify the part that triggered the problem first, we can then try to make sense out of that.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 11/6/2013 Posts: 5
|
I think I found the problem. we have the usual google analytics script on that page, which is causing the delay,I guess, as it is working fine now after I removed that particular script. I tested initially on two servers one with internet access and one without internet access, and it was slow on both of them. So, even though I have found the bottleneck, I am not sure why it is a problem as the page loads fine and fast with the google analytics script on the browser on HTTP GET and it slows down on HTTP POST while generating PDF. Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
That does not make sense. You may want to run wireshark on your server to see why GA would slow it down. What GA does is to send a request and then return a small GIF image. We use Google Analytics on our own website and we have ASPXToPDF sample on our website too. It runs fine without any problem.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 11/6/2013 Posts: 5
|
Going back to the original issue, how important is the need to be able to resolve the url to the local IP. e.g. let's say from the server locally (I logged on to the server and the server in DMZ), if I can pull up www.myserver.com/images/logo.png on a browser without any host file entry, does that mean ASPXtpPDF should work as well without any hostfile entry (www.myserver.com does not resolve to that localhost ip, but to a load balancer or some other router on the network)? The machine has internet connection as well. Still, if I try to run the pdf generation either from local server or from remote client, I encounter the same issue that I encountered before (it can't pull images, css,etc.). Once I add host file entry pointing to the local IP, it starts working. Could You throw some light on this issue? I am trying to avoid having to avoid adding host file entry in production as well. thanks PS: regarding google analytics script, we have the same GA script in all pages; pdf generation works fast without it and crawls when it is there. I already posted the wireshark log, while GA script was present on the page and I couldn't tell clearly the impact of GA in that log. The requests for images, stylesheets, scripts by aspxtopdf doesn't show up in wireshark log.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi, The log you posted is between your client computer (10.28.102.10) and your web server (10.28.102.70) and you were probably running WireShark on your client computer. You will not catch the image/script requests this way. The image/script request is from your web server to your web server (or GA's server for GA script). The source address of for the main page request is your client computer. The source address for the dependency request (image/scripts/css, etc) is your web server. This is where the converter differs from a regular browser session. For a regular browser session, the source for both cases are the same as your client computer. If the converter works when you put the host entry in and does not work without it, then it's definitely a DNS issue. Whether your host name resolves to the local IP or an IP to a different machine does not matter ---- it's whether that IP is reachable from within your web server matters. The converter does not do any kind of check on the DNS query result. It simply tries to load the resource based on that Url. It there is no problem with the network, then it will load fine. If there is a problem with the network/address, it will sit there wait until times out. And this is precisely what causes the long delay for you. Because of this, as long as you can pull www.myserver.com/images/logo.png on your browser from within the web server, the converter should work equally fine --- unless you run into something else like session affinity. That would be another potential issue that you may face when you have a load balancer. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 11/6/2013 Posts: 5
|
Thanks for the quick response. 1. i captured all the traffic in wireshark and I posted only the relevant tcp/http traffic that was captured in the earlier post. I went again and checked the saved log file to see if there was any traffic at all from ip.src == 10.28.102.70 to ip.dst == 10.28.102.70, and I didn't find any, but the pdf generation worked fine (though slow at that time with GA script)
2. Regarding the last paragraph - yes i can retrieve logo.png in a browser within the webserver, yet pdf generation doesn't work (placeholder for images) properly unless I add the host file entry. Once you add the host file entry, pdf generation would start working from remote browsers, but not the local browser I understand there is some kind of DNS issue going on here, may be related to session affinity. How to resolve if it is session affinity (will AutoFormsAuthentication to true help?)
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
As to WireShark traffic maybe it won't capture a local -> local traffic since it doesn't really go through the network adapter. So that's not an issue.
As to session affinity, that's usually has to do with your load balancer and your web server, but should not have anything to do with us. For example, if your ASP.NET application keeps session data in memory, and the load balancer decides to let you log in page that set the session data to be handled by server1, but another page that uses the session data by server2, then you would have a problem because server2 can't access any data set by server1 since the session data set by server1 is in server1's memory. These are the kind of issues you will have to face when you have a load balancer, there are various ways to resolve such issues but each have certain implications/restrictions.
If you can retrieve the image within the webserver, but PDF converter can not load it, then most likely the Url you use in your web server and the Url the converter uses are different. If they are the same Url, then if one work then the other one should work. You can try to modify your host entry to point the domain name to a different server and then run WireShark to capture the traffic to see what Url the converter is using. Note here you want IP in the host file to point to a different server since if you were to use the same server, then WireShark may not be able to capture the traffic.
Thanks!
|
|