giggls / osml10n

Localization functions for Openstreetmap
https://tile.openstreetmap.de
GNU General Public License v3.0
15 stars 7 forks source link

idea: using unix pipe #1

Closed frodrigo closed 2 years ago

frodrigo commented 4 years ago

Have you look at the usage of unix pipe to talk with the daemon rather than using a full ip network stack?

giggls commented 4 years ago

The answer is no, but nowadays at least on Linux communication via 127.0.0.1 should not be much slower than using Unix domain sockets anymore. I used http just for the sake of simplicity.

This is currently just a proof of concept implementation without speed optimizations.

joto commented 2 years ago

I have tried replacing the HTTP communication with a plain TCP socket running a simpe length+data protocol. This reduced processing time in my test to one third of the time needed with the HTTP communication. So there are some significant performance benefits when we don't need to open and close HTTP connections all the time. Using a pipe or Unix Domain socket will probably result in similar numbers. There is an advantage using HTTP because it makes it easier to plug stuff unto it, but the performance savings are large enough to seriously think about changing this.

giggls commented 2 years ago

"So there are some significant performance benefits when we don't need to open and close HTTP connections all the time."

I somewhat expected this. However we will need a simple client for debugging purposes then as curl will no longer work. Maybe netcat or socat will.

joto commented 2 years ago

I have created a PR #5 with my current test code. This includes a command line test program.