question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Static files serving (Nginx/Apache style)

See original GitHub issue

Thanks for your work, I’m trying to use your code (trying to create a separate HTTP(S) only library) to serve static files (like Nginx or Apache), just want to measure the performance.

For single requests in browser it works as expected, but under high load (autocannon -c 2500 -d 30 -p 4 http://HOST:PORT) I got tons of errors:

Error: Invalid access of discarded (invalid, deleted) uWS.HttpResponse/SSLHttpResponse. at Response._initiate_response (/something/Response.js:261:26) at Response.stream (/something/Response.js:469:10) at Object.middleware (/something/middleware/StaticFiles.js:101:20)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:29 (29 by maintainers)

github_iconTop GitHub Comments

1reaction
kartikk221commented, Jun 7, 2022

Try benchmarking uQuick and uWebsockets.js on a cloud provider instance. See if benchmarking over network brings the results between the two much closer as I have found the results of benchmarks over network to a different machine much more production accurate vs. local benchmarks over 127.0.0.1/localhost.

1reaction
piliugin-antoncommented, Jun 6, 2022

By the way, I tested my npm partially, and for now didn’t noticed any bugs. So you can Install it to see the difference. Unfortunately I can’t test it on a VPS, becuase I’m from country which is under economic sanctions

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serving Static Content | NGINX Plus
Configure NGINX and NGINX Plus to serve static content, with type-specific root directories, checks for file existence, and performance optimizations.
Read more >
How To Configure Nginx as a Web Server and Reverse ...
Nginx is faster than Apache in serving static files like images, JavaScript and style sheets. So let's configure Nginx's apache virtual host ...
Read more >
Apache and Nginx Settings
Go to Websites & Domains > Apache & nginx Settings and scroll down to the “nginx settings” section. Select the Proxy mode and...
Read more >
Nginx/Apache Serve Static Content proxy
I need help with improving a nginx pattern matching regex. Apache runs on port 8080 and nginx runs on port 80. The only...
Read more >
Nginx (for static files) and Apache (for dynamic content)
So, my entire application runs on apache just fine. However, I want to test how much the requests per second increases if I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found