On 6/1/2020 11:12 AM, Sam Tobin-Hochstadt wrote:
I think the biggest thing is that no one has looked at optimizing
these benchmarks in Racket. If you tried out running one of these
benchmarks and ran the profiler it would probably show something
interesting.
Sam
The code[1] itself isn't bad. There are a couple of minor things I
personally would tweak, but in my opinion the main problem is with the
database access.
Postgresql uses process parallelism - it forks a new backend process to
handle each connection. Assuming (???) there are enough concurrent
requests to open the maximum number of DB pool connections, then 1024 is
WAY too many. PG experts recommend no more than 5..10 backend processes
per core, but according to the environment details[2], the test machines
have only 14 HT cores (28 threads).
Mind you I'm only guessing, but it looks to me like this application
could be losing an enormous amount of time in the starting of new
backend database processes. And since it is running inside a Docker
container, there also is some per connection overhead there.
The requests made by the tests[3] are so trivial (needing little
additional Racket processing) that I would consider reducing the number
of PG pool connections to just a few per core and see how that goes. My
expectation is that the time saved by spinning up many fewer PG
processes will vastly outweigh any loss in absolute request
concurrency. [Particularly if they also are running PG itself inside
Docker.]
YMMV,
George
[1]
https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/Racket/racket/servlet.rkt
[2]
https://www.techempower.com/benchmarks/#section=environment&hw=ph&test=fortune
[3]
https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-users/eafb41e8-734c-7666-e684-edade3731e79%40comcast.net.