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

HTTP 400 error when sending lots of requests at once. #420

Closed
davidseverwright opened this issue Sep 21, 2023 · 11 comments
Closed

HTTP 400 error when sending lots of requests at once. #420

davidseverwright opened this issue Sep 21, 2023 · 11 comments
Assignees

Comments

@davidseverwright
Copy link

I've been having errors when sending multiple requests at once. It's a mix of HTTP 400 and timeouts.

In my setup, I have a queue runner sending reports. Every hour docker starts the export server and my queue runner, and then stops them both once the queue is empty.

I had the export server set to run 4 workers, and my queue runner was running 4 threads; there's no rate limiting so the 4 workers were getting hit non-stop.
With the old export server this was fine, with 3.0.0-beta.2 it works for about ~125 requests then became 99% errors.

I've now changed it to only have 1 worker and 1 queue runner, and it's now running without issue.
I've tried increasing the CPU and RAM allocated, seems to reduce the timeouts but still get the 400's.

All testing was done with around 600 charts being created
4 workers, 4 queues = bad (~125 queries, then very high errors.)
4 workers, 1 queue = fine
1 worker & 2 queues = eventually a few errors (~400 queries, then ~50% error for a while, then fine again)
1 worker & 1 queue = fine

The number of workers doesn't seem to matter, just the number of requests coming at once.

The attached log is with 4 threads sending requests, and --workers 4. 2vCPU and 8 GB of RAM, on AWS Fargate.
With just one core and 2GB it's about the same error rate but more timeouts. The timeouts also increase over time, so maybe related to the memory leak bug?

highcharts-error.log

@jszuminski
Copy link
Contributor

Thanks for reporting!

Seems like it's related to: #412

@jszuminski
Copy link
Contributor

@davidseverwright could you please share the following details:

  1. Are you injecting resources (JS/CSS)?
  2. Does the memory use increase over time for you?

@davidseverwright
Copy link
Author

I'm not injecting any CSS/JS, and the memory usage is fluctuating a bit but isn't just climbing like the graph in #412.

With 4 workers and 4 jobs I get lots of errors and this: 4-jobs-at-once

With 4 workers and one job at a time, there's no errors and this: 1-job

@jszuminski
Copy link
Contributor

@davidseverwright we've recently merged a new PR (#422) where we replaced the generic-pool package with tarn.

This could be a possible fix of this issue. Could you please try out the latest version (from the master branch or from the npm [email protected]) and let us know whether it solved it for you?

@davidseverwright
Copy link
Author

Hi, thanks for looking into this.

It seems a lot better (less errors) but there are still errors. The log is attached.
This was run with 4 workers, and 4 simultaneous requests. It's still all OK with one request at a time.

hces-errors.txt

@PaulDalek
Copy link
Contributor

Hi @davidseverwright

Thank you for all the information. We released v3.0.2 recently. Could you check how the server performs on your side with this version?

@PaulDalek PaulDalek self-assigned this Nov 16, 2023
@davidseverwright
Copy link
Author

Hi,

I just tested this with Highcharts v11.2 and export server v3.0.3, and got the same errors.
hces.log

@shawnwall
Copy link

noting we've been seeing increased 400's against the official highcharts export server as well.

@anantjagania
Copy link

Facing the same issue. The app requesting charts from server constantly gets 400s.

Found this in error logs.

Wed Mar 27 2024 22:31:41 GMT+0000 [error] - [export] Error encountered during export: Error: Rasterization timeout Wed Mar 27 2024 22:31:41 GMT+0000 [error] - [export] Error encountered during export: Error: Rasterization timeout Wed Mar 27 2024 22:31:42 GMT+0000 [error] - [export] Work: b8596f4cbb744301ba483c3fca412341 could not be completed, sending: In pool.postWork: Error trying to perform puppeteer export: In pool.postWork: Error: Rasterization timeout.

@dmytromakohin
Copy link

dmytromakohin commented Apr 16, 2024

We have the same issue.

Sometimes after exporting of images via highcharts it redirects to "not working" page.

Will you fix this issue or we need to find alternative to highchart export?

It is very critical for us to have stable export on website which always works.

Screenshot_56

@jszuminski
Copy link
Contributor

Most likely fixed by #521 in v4.0.0 (currently on the master branch).

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

6 participants