Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Home page performance improvements #124

Closed
torrin47 opened this issue Jun 13, 2017 · 4 comments
Closed

Home page performance improvements #124

torrin47 opened this issue Jun 13, 2017 · 4 comments

Comments

@torrin47
Copy link
Contributor

So I'm concerned that even though the new page is performing better in production than staging, it's still putting a lot of load on the server. One way we could pretty easily improve the performance is if instead of doing direct queries to the server for all of the thumbnail displays, we could create caches of each JSON output that are updated hourly. I'm pretty comfortable putting together the script that would produce the cache .json files, but I believe that right now the page is structured in a way that derives the "See More" link from the search term we use to pull the thumbnails. We'd need those to be separate, so that even though the thumbnails are coming from cached json, the "See More" link will still go to the search page with the right search term.

@torrin47
Copy link
Contributor Author

Unfortunately, the performance was so slow on production that our monitoring script decided the site was down 4 times in the first hour. Can't live with that, rolled back to old version until we can address stability.

@torrin47
Copy link
Contributor Author

So I was reviewing the logs trying to understand the performance impact, and noticed one thing right at the outset. Each REST query ended up making 3 separate calls, following this pattern:

2017-06-13 22:39:45 134.67.221.182 GET /metadata/RestQueryServlet start=1&max=6&f=json&owner=11&max=6 443 - 134.67.221.182 Java/1.8.0_112 200 0 0 226 2017-06-13 22:39:45 134.67.221.182 GET /metadata/RestQueryServlet start=1&max=6&f=json&owner=11&max=6 443 - 134.67.221.182 Jakarta+Commons-HttpClient/3.1 200 0 0 208 2017-06-13 22:39:45 134.67.221.182 GET /metadata/rest/find/document owner=Region%209&start=1&max=6&f=json 443 - 134.67.221.182 GeoportalServer 200 0 0 469

I don't really know what the RestQueryServlet is or how requests are directed there, but I tried switching the URLs we have embedded in the homeBody.jsp to point directly at the RestQueryServlet, and it dramatically cut down on the number of hits logged, reduced the page loading time from ~30s to ~13s. Which is pretty sweet, but I still think it's worth pursuing the cache option. I'll check in the tweaks.

@Saisuma004
Copy link
Contributor

Saisuma004 commented Jun 14, 2017 via email

@torrin47
Copy link
Contributor Author

This issue was moved to USEPA/EPA_Environmental_Dataset_Gateway#22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants