-
Notifications
You must be signed in to change notification settings - Fork 0
[$150] Getting 504 error when creating discussions and comments #400
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
Comments
@atelomycterus - anything we can do to debug this? |
Challenge https://www.topcoder.com/challenges/b9a974d7-3594-4893-ba79-2e79e6df2a37 has been created for this ticket. |
@jmgasper Duplicate #381 504 (Gateway Timeout) status code indicates that the server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request.
I ran it with the profiler locally with old Vanilla DB (~500+categories) . It generates 900+MB files per a request for discussion and 400+MB for comment. It works slowly with enabled profiler. With enabled profiler adding a discussion/comment 1.3-2.7 mins, without - 300 ms-7 secs. The greater the depth of the category, the more recalculations and changes in the cache and the execution time increases. I'll ran with 2000+/5000+ categories locally and test it. A large number of categories become a concern. Are there any applications (using UI or Vanilla API) that insert a large amount of data? Maybe there was testing on the QA server? Adding data by sql script is not correct, because category are implemented using nested set model. If not, then no problem, I'll write PHP scripts that will generate the data. Now in DEV 1700+ categories if we ran it with the profiler it'll be not less 1,2-1,5GB per request for creating a discussion, maybe 2-3 GB or more. I am going to work on it today. Keep you updated. |
Challenge https://www.topcoder.com/challenges/b9a974d7-3594-4893-ba79-2e79e6df2a37 has been assigned to obog. |
@atelomycterus - I've asked for a database backup to be provided. If we had that many challenges, that would be that many categories though, correct, since each challenge will have multiple categories? |
@jmgasper Thanks! 3 categories are added for a development challenge: 1 category is added for a design challenge: So I am going to test first with a 2k/5k/10k thousand categories locally. In any case, I will add metrics to the code so that we can look at execution time in log files/debug bar (without a profiler). The profiler cannot be run on a live system (PROD). Type=Heading - This type as an option will reduce the number of nested categories. We will keep this as a fallback. We should try to do something with the current version. Category TypesType=Discussions: A basic category where users can post discussions. Only categories set to the Discussions type can contain discussions. All other types of categories will not be selectable when choosing where to add a new discussion. Type=Nested: No discussions can be added directly inside a Nested category. Creates a clickable heading that only contains more categories. Type=Heading. We don't use it. Type=Flat. We don't use it.
|
@atelomycterus - Ok, thanks. The number of challenges will grow as we use it more in more in prod, so if we can address the issue now, that'll be good, thanks. |
@jmgasper Do you know if there was a restart/re-deploy of any services (ngnix, memcached, DB or so on) in DEV today? When this issue was created, adding a discussion/comment was very slow and there was 504 error. 1-2 hours ago I posted 9 comments + 7 discussions, no 504/502 errors. |
@atelomycterus - I don't know, but I've asked Topcoder if they know. @rootelement ☝️ |
@atelomycterus -From Topcoder:
|
@atelomycterus For QA testing I created comments from the UI using a selenium script, but I didn't create any categories. I just simulated the user behavior through UI, didn't execute any sql scripts. Here are the comments I created https://vanilla.topcoder-dev.com/discussion/3130/perf-test. Also I see even though it gives time outs, the discussions are being created. |
@sdgun Thanks for info! A few questions:
I think that if you create discussions with a selenium script, then the same problem will be. Could you share this script? Thanks! |
@atelomycterus I have added 5.7K comments and the last comment was added Feb 12 2021 at 04:33 PM. The code is attached. The gap between comments were 6 seconds. But please note all these 5.7k were not added the same day. I started running the test on 6th Feb and ran it time to time till 12th Feb. You can see this in https://vanilla.topcoder-dev.com/discussion/3130/perf-test |
@sdgun - Is it alright if I put those test sources into Git? I'd like to keep those captured somewhere for reference, thanks. |
@jmgasper No problem |
Payment task has been updated: https://www.topcoder.com/challenges/b9a974d7-3594-4893-ba79-2e79e6df2a37 |
Verified by creating multiple discussions and comments, didn't observe timeouts again. |
Verified in Production |
Steps
Log in and create a new discussion/comment
Getting Timeouts
The text was updated successfully, but these errors were encountered: