You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That tells the Data.Pool(hasql pool dependency) reaper is the one using the CPU while idle, I increased the Pool timeout to 3600 to see if it helped but still got same 0.7% CPU usage:
3600 pool timeout profile
postgrest +RTS -N -I2 -p -h -RTS config
total time = 0.04 secs (43 ticks @ 1000 us, 1 processor)
total alloc = 6,154,576 bytes (excludes profiling overheads)
Then noticed that the Data.Pool reaper works every second, so removed the 3600 timeout and patched the threadDelay to 30 secs(just a number I got from a Rust pool) and now the reaper doesn't use CPU significantly(again a 5 mins profile while idle):
Still got around 1.5%/2.0% at around 20 secs when running it though, I disabled idle GC by compiling with I0 and now CPU usage is 0.0% most of the time(getting 0.7% usage at around 6 mins).
The idle CPU usage matters when having multiple postgrest instances adding up infrastructure costs.
The text was updated successfully, but these errors were encountered:
Testing this on an Archlinux x64 - i7 4790 - 8GB RAM, when running
top -p $(pgrep postgrest)
about every 1 sec I see a%CPU 0.7
usage.Did a profile on an idle postgrest running about 5 mins and I got:
Idle profile
That tells the Data.Pool(hasql pool dependency) reaper is the one using the CPU while idle, I increased the Pool timeout to
3600
to see if it helped but still got same0.7%
CPU usage:3600 pool timeout profile
Then noticed that the
Data.Pool
reaper works every second, so removed the3600
timeout and patched thethreadDelay
to30 secs
(just a number I got from a Rust pool) and now the reaper doesn't use CPU significantly(again a 5 mins profile while idle):30 secs reaper profile
Still got around
1.5%/2.0%
at around 20 secs when running it though, I disabled idle GC by compiling withI0
and now CPU usage is0.0%
most of the time(getting0.7%
usage at around 6 mins).The idle CPU usage matters when having multiple postgrest instances adding up infrastructure costs.
The text was updated successfully, but these errors were encountered: