News for hackers. Stuff that matters.
Re:Why SQLite is so great for the edge by remram on Tuesday June 06, 2023 @11:18AM (#36214182)
Slight tangent: Is a UNIX socket faster than TCP over loopback?
Re:Why SQLite is so great for the edge by mfalcao on Tuesday June 06, 2023 @02:06PM (#36216768)
In my experience they are 30 to 40% faster
Re:Why SQLite is so great for the edge by remram on Tuesday June 06, 2023 @02:36PM (#36217199)
Wow that is significant!
Re:Why SQLite is so great for the edge by sgt on Tuesday June 06, 2023 @02:07PM (#36216787)
Someone should benchmark that. Unix sockets in my mind should be faster as in theory you have less overhead. But the flow using TCP over loopback might have received many more optimizations over the last decades.
Re:Why SQLite is so great for the edge by mfalcao on Tuesday June 06, 2023 @11:02PM (#36222354)
Here's a quick benchmark with pgbench:

  $ pgbench -h localhost -p 5432 -b select-only -T 60 -c 10 -j 2 bench
  Password: 
  pgbench (15.3 (Ubuntu 15.3-1.pgdg22.04+1))
  starting vacuum...end.
  transaction type: <builtin: select only>
  scaling factor: 1
  query mode: simple
  number of clients: 10
  number of threads: 2
  maximum number of tries: 1
  duration: 60 s
  number of transactions actually processed: 10370147
  number of failed transactions: 0 (0.000%)
  latency average = 0.058 ms
  initial connection time = 54.881 ms
  tps = 172993.008029 (without initial connection time)

  $ pgbench -h /var/run/postgresql -p 5432 -b select-only -T 60 -c 10 -j 2 bench
  pgbench (15.3 (Ubuntu 15.3-1.pgdg22.04+1))
  starting vacuum...end.
  transaction type: <builtin: select only>
  scaling factor: 1
  query mode: simple
  number of clients: 10
  number of threads: 2
  maximum number of tries: 1
  duration: 60 s
  number of transactions actually processed: 16890415
  number of failed transactions: 0 (0.000%)
  latency average = 0.036 ms
  initial connection time = 7.186 ms
  tps = 281540.260418 (without initial connection time)
YMMV depending on your workload, but Unix sockets should always be significantly faster.
Re:Why SQLite is so great for the edge by sgt on Wednesday June 07, 2023 @03:39AM (#36224011)
Very interesting! Thank you for the effort.