Is it possible to configure outgoing compression on calls coming into and going out of the kdb+ server?
Preferably over WebSockets?
Is it possible to configure outgoing compression on calls coming into and going out of the kdb+ server?
Preferably over WebSockets?
it’s automatic for ipc protocol when
uncompressed data is > 2000 bytes
not a localhost connection
compresses to <.5*original
For investigation, you can use -8!x to serialize, and -18!x to serialize with compression; -9!x will deserialize both of those results.
Websockets - there’s a compression standard (per message compression using deflate) that we could build-in, transparent to users, if there’s enough demand. Chrome already appears to support it.
Thanks Charles … I’m new to kdb+ care to share some simple examples of how to use
-8!x
-18!x
-9lx
Btw, you can’t control the compression with those commands - they’re merely there to help in things like debug, or if you happen to require that functionlity of serialization outside of ipc.
-8!x serializes object x to a byte vector without using compression. These are the exact bytes (other than msg type) that would be sent down the socket. e.g.
q)-8!a
b`c
0x01000000140000000b0003000000610062006300
-18!x is the same except it will attempt compression
q)-18!2001#0
0x010001009a000000963e0000c80700d10700000000ff00ffff00ff00ff00ff00ff0…
-9!x deserializes that stream, e.g.
q)-9!0x01000000140000000b0003000000610062006300
a
b`c
there’s more info on ipc formats etc here