im using astro + express but in my case its only handling 60rps which is pretty slow i guess. Maybe something wrong with the project? https://stackblitz.com/edit/js-evqegx?file=index.js
#[resolved] performance seems low
58 messages · Page 1 of 1 (latest)
first time using stackblitz so it could be broken. Use github repo instead https://github.com/awfulminded/testets
Just curious, how many rps do you get in other express apps in your PC?
On the same stress settings raw express returns 5k+ rps and I guess it’s not maximum
Test results are from /auth/signup route
I'm no expert but, if this doesn't happen in other routes maybe it's caused by the fetch call in the getUser function?
Actually I tested only one route but I guess getUser is not the problem
after the end of ddos the server is still not responding and continues to send logs from i18next
That's the only thing I had in mind, sorry I couldn't be more helpful
Can you test on a blank page, taking your code out of the equation?
I assume this is a prod build and not the dev server right?
index.astro
---
import "@styles/auth/auth.css";
import Layout from "@layouts/Layout.astro";
---
<Layout >
<h1>Hello World</h1>
</Layout>
<script src="@scripts/auth/prevent_default_forms.js"></script>
<script src="@scripts/auth/register.js"></script>
yeah its prod build. here is server.js
And its just raw express with hello world server
but in this case server still working with 6k rps ddos while astro drops at 100
can you not create an equivalent hello world?
or are you saying that's equivalent?
I'll create an example, we don't really have benchmarks right now so its possible we have had a regression somewhere along the lines that has made it slower
i'll take express out of the equation as that's not really a factor here
So this example is not running your auth stuff, right?
Thank you for bringing this to our attention @wheat patio
Just created a completely clean astro project, but the result hasn't changed. Therefore, I think that the problem is not with my code.
here is this project
Switched from express to this, but rps is the same
soo should i do something now?
There's nothing you can do to work around it, seems to be a problem with our code
i have some ideas of what it might be and am investigating
i have the same issue, use deno instead and it's at least 10x faster
we can make it faster
yeah you`re right deno is way faster but its still feels not enought
but its on npm run preview, im not sure that its exactly what gonna be in prod
cloudflare wrangler is also faster in preview, but not as fast as deno, Node is seriously off
I have faith that Matthew can figure this out, 🙏
i did a little research and found that maximum rps for deno with astro is around 5k which is not really much
and deno itself not seems like a good perfomance tihing
Hi @wheat patio could you share your research with us, if possible,
perhaps research is too big a name for what I did. I just opened several wrk windows and in total the server withstood 6k rps
interesting, im sure we could reproduce those steps,
its a fork of original wrk with py script to run multiple windows
https://www.npmjs.com/package/autocannon is good for this
we are spending a lot of time in promises, unfortunately
this article is claiming about 15k reqs/second with express: https://plainenglish.io/blog/how-many-requests-can-handle-a-real-world-nodejs-server-side-application
I'm seeing around ~10k in my testing using a similar setup with an Astro hello world
We can help by reducing the use of async iterables in the rendering pipeline, added almost 1k r/sec in my testing
but the biggest gain would be by removing async functions in the pipeline and using callbacks instead
that sounds like some considerable effort,
so what should i do? its still around 60 rps for me on astro hello world with express
i guess it could be better with deno but this happens
Are you seeing this problem on your actual servers or just locally on your windows computer?
60 rps is indeed very slow but I'm not seeing that, or anything close to it. One thing is that Astro creates more objects and uses more memory than a plain express app, is it possible that your computer is memory constrained?
i have plenty of memory left i see it on a linux box. Like awaken i have some issues with i18next that only works with node (only SSR they support for now as per doc) .
- basic almost static page : DENO 4 ms | NODE 60 ms
- API call & render 50 cards : DENO 40 ms | NODE 1.3 s (express doesn't deflate by default so data returned is much bigger, but wait time from node is 1s)
Got another report. I think I know what is causing it. Will submit a fix this upcoming week
@graceful tartan I have a possible fix here, if you can test it out and let me know: https://github.com/withastro/astro/pull/4956#issuecomment-1265537773
Just released 1.4.3 with this change which improves in some projects. Curious to hear if it helps for you.
Hi @all. This issue was fixed in the latest version (1.4.4). For my use-cases it fixed HTML rendering/generating times from 500-800ms to 10-20ms 🙂 https://github.com/withastro/astro/issues/4958
Thank you @hearty python 👍
[resolved] performance seems low