-
Notifications
You must be signed in to change notification settings - Fork 25
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
Admin Page is Really Slow #380
Comments
One of the main causes of this problem is the huge DC map which includes all the labels. There seems to be a way to make the map a little bit faster by using canvas instead of SVG layers. It seems to be in the leaflet's documentation too (note that the example in the documentation is exactly the problem we have — "many thousands of circle markers on the map"). I checked this solution and it makes it significantly faster (but it is not perfect yet) on my localhost. However, the image quality is reduced a little bit (my guess is that it only happens in high-density displays though). Here is a screenshot for comparison:
|
Two of the tables (labels and users) are quite huge as well. On my computer removing them reduced the page load time to 3-5 seconds from 10 seconds (as measured by Page load time chrome extension). Moving these tables to different pages should help significantly. |
Adding Anthony's recent investigations (in #588):
|
Yeah well over 50% off the time of loading the initial admin page is from the user table. I think this is because we are querying for the list of users, then for each user we are running 5 separate queries to get metadata about them. I think if we did this in just a single query (or even in 5 queries) instead of having a number of queries equal to 5 times the number of users, this would be a lot faster. I'm talking about bringing the admin page loading time from 2 minutes to 30 seconds or so, so it still isn't going to be fast at all 😁 |
Reducing the number of queries is important... another strategy is pre-computing data and offloading to another table. Is that easy to do? |
It is definitely more complicated than just optimizing the queries themselves, especially if we want to be able to see the most up-to-date information on the admin page (which we often do), b/c that would require real-time updates to those tables. I think that pre-computed tables are always an option, but are closer to a last resort (especially if it is just for the admin page). We probably all agree that the way to do this is to iteratively look for what part of the page is taking the longest to load and fixing that. So if this part still takes longer to load than anything else, then we should look into pre-computing here. |
Okay so I found a few cases where adding an index to a table improves performance for certain queries. It isn't a silver bullet, but it can definitely help in some cases. The best part is that it really doesn't have a downside for us. The typical downside is that it makes insertion and deletion queries slower, but that isn't a problem for us at all right now. It is also nice because adding indices doesn't require adding new code. We can just log into the server and make those updates to the database. |
Furthermore, I think that we should make these updates directly to the database ourselves instead of adding them to a Play evolutions file in the code because some of the indices we want to add will take hours to create, and that's not something I think we should have running automatically whenever someone wants to test out old versions of the code in the local dev environment. |
And the most time-consuming query we have is the one that computes the amount of time audited by each user. I think that we should pre-compute these values and put them in a table, updating nightly. This query isn't being used on the main admin page, it is only run when you click on the "analytics" tab, but it takes something like 5 minutes to run. |
Definitely, agree. They shouldn't be a part of the play evolutions.
However, they can be a part of the initial evolutions script when we set up
a new database and the application e.g. for a new city. On an empty
database, its quicker and who don't have deal with slow indexing.
…On Fri, Oct 5, 2018 at 11:05 AM Mikey Saugstad ***@***.***> wrote:
Furthermore, I think that we *should* make these updates directly to the
database ourselves instead of adding them to a Play evolutions file in the
code because some of the indices we want to add will take hours to create,
and that's not something I think we should have running automatically
whenever someone wants to test out old versions of the code in the local
dev environment.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#380 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACvXgIWRw9XByZP3n1KJfox_tpntyQOCks5uh59xgaJpZM4KjCq1>
.
--
Best Regards,
Manaswi Saha
Ph.D. Student
Paul G. Allen School of Computer Science & Engineering
University of Washington, Seattle
*homes.cs.washington.edu/~manaswi <http://homes.cs.washington.edu/~manaswi>*
Twitter - @manaswisaha <https://twitter.com/manaswisaha>
|
Agreed, I'm not exactly sure what the process is for creating a new database yet, but I think the fresh database we make should be set up correctly like this :) |
When we get back to improving the load times of the Admin page (pretty important right now, since we can't even see the Admin page in Seattle #3544), it should be noted that the tabbed interface did a lot to help here, and I think that the low hanging fruit has been picked already. I did some profiling on my local environment: The page takes about 50-55 seconds to load, but no single query took more than 2 seconds total, even if it was used multiple times. The remaining methods of speeding up the initial page load that remain:
Here are a few functions I've seen that could benefit from some of this consolidation and removal from the template scala:
The list goes on! When working on this, you may want to try to prioritize which functions you do this to based off of the total time spent across all versions of that function. I just did a quick test of this for the
to this
I did this for all three |
I created this issue to address the performance problem in the admin page. As we all know, the admin page takes a while to load. And even after it is loaded, it is very slow due to the massive data that needs to be loaded and rendered in the page. This needs to be fixed.
Related issue: #343
The text was updated successfully, but these errors were encountered: