Re: [GENERAL] Memory usage per session
=D0=97=D0=B4=D1=
=80=D0=B0=D0=B2=D1=81=D1=82=D0=B2=D1=83=D0=B9=D1=82=D0=B5.
>> Oracle: about 5M
>> postgreSql: about 160=D0=9C
>=E2=80=8BI'm admittedly ignorant of this type of testing. But if the me=
mory usage for PostgreSQL is in the server, perhaps due to caching (how to =
test?), then it likely would _not_ linearly scale up >as the number of c=
lients increased because every clients >would share the same cache data =
within the server.=E2=80=8B Or are you measuring the memory usage where the=
client is on one machine and the >PostgreSQL server is a different mach=
ine, with the client machine getting the memory hit?
I can send zip file with test code on request;
To say the truth it's described in documentation:
https://www.postgresql.org/docs/9.5/static/plpgsql-implementation.html#PLPG=
SQL-PLAN-CACHING
The PL/pgSQL interpreter parses the function's source text and produces an =
internal binary instruction tree the first time the function is called (wit=
hin each session)
It's very sad :(
The test is very simply:
Generate code:
DECLARE
svSql "varchar";
BEGIN
for nvi in 1..10
loop
svSql =3D 'CREATE OR REPLACE FUNCTION perfa."func'||nvi||'" (=
)
RETURNS void AS
$body$
DECLARE
svSql "varchar";
BEGIN
svSql:=3D'''';
PERFORM perfb."func'||(nvi-1)*10+1||'"();
PERFORM perfb."func'||(nvi-1)*10+2||'"();
PERFORM perfb."func'||(nvi-1)*10+3||'"();
PERFORM perfb."func'||(nvi-1)*10+4||'"();
PERFORM perfb."func'||(nvi-1)*10+5||'"();
PERFORM perfb."func'||(nvi-1)*10+6||'"();
PERFORM perfb."func'||(nvi-1)*10+7||'"();
PERFORM perfb."func'||(nvi-1)*10+8||'"();
PERFORM perfb."func'||(nvi-1)*10+9||'"();
PERFORM perfb."func'||(nvi-1)*10+10||'"(); &nbs=
p;
END;
$body$
LANGUAGE ''plpgsql''
VOLATILE
CALLED ON NULL INPUT
SECURITY INVOKER';
EXECUTE svSql;
end loop;
END;
Download jmetter
In 50 thread run this funciton.
About 4g memory will be consumed in one second
It's hard to miss
:))