Skip to content

Commit 9f43d30

Browse files
pavelmashpavel.mash
and
pavel.mash
authored
[mORMot] speed up pipelining; speed up docker build (#8057)
* [mORMot] using a modified libpq that allows to send the PipelineSync command without flushing prev. commands to socket * [mORMot] fix dockerfile, speed up a docker build command * [mORMot] shorten server name for better plaintext performance * [mORMot] change `Server` header value to `mmt` because `M` provokes debate * [mORMot] use 1 letter server header, till is NOT added as a rule and verification --------- Co-authored-by: pavel.mash <[email protected]>
1 parent 99141b6 commit 9f43d30

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

frameworks/Pascal/mormot/mormot.dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ RUN /bin/bash -c ./setup_and_build.sh
1111

1212
FROM ubuntu:22.04
1313
COPY --from=builder /build/bin/fpc-x86_64-linux/raw /usr/local/bin/raw
14-
15-
RUN apt-get update && apt-get install -yqq postgresql-client
14+
COPY --from=builder /build/libpq.so.5.16 /usr/lib/x86_64-linux-gnu/libpq.so.5
1615

1716
EXPOSE 8080
1817
CMD ["raw"]

frameworks/Pascal/mormot/setup_and_build.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ echo "Download statics from $URL ..."
3535
wget -qO- "$URL" | tar -xz -C ./libs/mORMot/static
3636

3737
# uncomment for fixed commit URL
38-
URL=https://github.com/synopse/mORMot2/tarball/c57d48846f050f4f68856758d28cf76450addaf2
38+
URL=https://github.com/synopse/mORMot2/tarball/edf377a61aa5ac99add92d144480b12095f578c2
3939
#URL="https://api.github.com/repos/synopse/mORMot2/tarball/$USED_TAG"
4040
echo "Download and unpacking mORMot sources from $URL ..."
4141
wget -qO- "$URL" | tar -xz -C ./libs/mORMot --strip-components=1
4242

43+
# download our modified libpq what do not PQflush inside PQPipelineSync
44+
URL=https://github.com/pavelmash/postgres/releases/download/5.16_PQpipelineSync_noflush/libpq.so.5.16
45+
echo "Download modified libpq from $URL ..."
46+
wget -q -O./libpq.so.5.16 "$URL"
4347

4448
# uncomment line below to echo commands to console
4549
set -x

frameworks/Pascal/mormot/src/raw.pas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ constructor TRawAsyncServer.Create(
193193
hsoIncludeDateHeader // required by TPW General Test Requirements #5
194194
] + flags);
195195
fHttpServer.HttpQueueLength := 10000; // needed e.g. from wrk/ab benchmarks
196+
fHttpServer.ServerName := 'M';
196197
// use default routing using RTTI on the TRawAsyncServer published methods
197198
fHttpServer.Route.RunMethods([urmGet], self);
198199
// wait for the server to be ready and raise exception e.g. on binding issue
@@ -233,6 +234,7 @@ function TRawAsyncServer.GetRawRandomWorlds(cnt: PtrInt; out res: TWorlds): bool
233234
pStmt.SendPipelinePrepared;
234235
pConn.PipelineSync;
235236
end;
237+
pConn.Flush; // we use modified libpq what not flush inside PQPipelineSync - flush manually
236238
for i := 0 to cnt - 1 do
237239
begin
238240
pStmt.GetPipelineResult;

0 commit comments

Comments
 (0)