Project

General

Profile

Actions

Defect #33148

open

application stuck if query with filter "Issue" and with large amount of IssueIDs

Added by Taine Woo about 4 years ago. Updated about 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Issues filter
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Project -> Issue,
Add filter "Issue", operator "Is", value: please input a lot of IDs, such as 1,2,3,4,5,6,7.
If the amount of the IDs is too large (in my case, more than 200 IDs), the query is stuck, and there is not SIGQUIT signal sent to webserver to terminal the request.
The webserver will keep waiting for the application to response the request, passenger-status shows the CPU usages of the redmine process is 100%.
At this point, the webserver process can not response for further requests.
If you continue retry the query for more times to make all webserver process are occupied, all users can not use the webserver (always loading).

Please set the timeout for requests.

Actions #1

Updated by Mizuki ISHIKAWA about 4 years ago

I think it is common to time out on a web server such as Apache or Nginx instead of a Rails application.

Actions #2

Updated by Taine Woo about 4 years ago

Mizuki ISHIKAWA wrote:

I think it is common to time out on a web server such as Apache or Nginx instead of a Rails application.

Ruby application host Passenger provides a configuration option for request timeout, but it requires Enterprise version of Passenger.
I use apache and open source passenger so i can not use this option.
And it also suggests application should handle the request instead of the work around provide by application host.
https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequesttime

"This option should be considered as a workaround for misbehaving applications. It is advised that you fix the problem in your application rather than relying on this option as a measure to avoid stuck applications."

Actions #3

Updated by Taine Woo about 4 years ago

Taine Woo wrote:

Mizuki ISHIKAWA wrote:

I think it is common to time out on a web server such as Apache or Nginx instead of a Rails application.

Ruby application host Passenger provides a configuration option for request timeout, but it requires Enterprise version of Passenger.
I use apache and open source passenger so i can not use this option.
And it also suggests application should handle the request instead of the work around provide by application host.
https://www.phusionpassenger.com/library/config/apache/reference/#passengermaxrequesttime

"This option should be considered as a workaround for misbehaving applications. It is advised that you fix the problem in your application rather than relying on this option as a measure to avoid stuck applications."

And the KeepAlive option of apache is not working for this case, because the application host passenger is working but waiting for the application Redmine, but the application Redmine stucks without return/kill.

Actions #4

Updated by Taine Woo about 4 years ago

But anyway, why is the query performance so bad...?
with only 200 query

Actions #5

Updated by Taine Woo about 4 years ago

----------- Application groups -----------
/xxxxxx/redmine-4.0.3 (production):
App root: /xxxxxx/redmine-4.0.3
Requests in queue: 0 * PID: 17124 Sessions: 1 Processed: 3 Uptime: 1m 4s
CPU: 37% Memory : 176M Last used: 17s ago

.....
.....
.....
after the redmine application stuck for some minutes, the CPU usage became 100%,

----------- Application groups -----------
/xxxxx/redmine-4.0.3 (production):
App root: /xxxxx/redmine-4.0.3
Requests in queue: 0 * PID: 17124 Sessions: 1 Processed: 3 Uptime: 8m 32s
CPU: 91% Memory : 176M Last used: 7m 45s ago

and during all time, this process of application can not accept other request, so the application host passenger have to start another application process to host redmine.
and if there is another 200 ID query, the new process will be stuck too.
So, after some tries by the user, all the server resource will be occupied, and reach the max process allowed of passenger, and then, no one can browse the web server again, because the application host (passenger but not web server apache) is out of resource.

Actions #6

Updated by Mizuki ISHIKAWA about 4 years ago

Taine Woo Woo
I understand why you need the timeout function. Thanks for the details!

Actions #7

Updated by Taine Woo about 4 years ago

Mizuki ISHIKAWA wrote:

Taine Woo Woo
I understand why you need the timeout function. Thanks for the details!

Hi Mizuki,

It would be good if the query for case "=" is refined. for several Ids, the query should uses "where xxx IN (aa,bb,cc,dd)". The sql executes very smooth. But the code makes the query stuck.

Actions

Also available in: Atom PDF