Init connection time grows quadratically

Started by Потапов Александр8 months ago5 messages
#1Потапов Александр
a.potapov@postgrespro.ru
2 attachment(s)

Hello!
 
I ran some experiments with pgbench to measure the initialization time and found that the time increases quadratically with the number of clients. It was surprising to me and I would like to understand a reason of such behavior.
 
Some details on how it was done:
 
1) I used the branch REL_16_STABLE (commit 2caa85f4).
 
2) The default system configuration was modified (CPU speed control, memory control, network, ram disk). Briefly:
    sudo cpupower frequency-set -g performance
    sudo cpupower idle-set -D0 
    sudo swapoff -a 
    sudo sh -c 'echo 16384  >/proc/sys/net/core/somaxconn'
    sudo sh -c 'echo 16384  >/proc/sys/net/core/netdev_max_backlog'
    sudo sh -c ‘echo 16384  >/proc/sys/net/ipv4/tcp_max_syn_backlog’ 
    numactl --membind=0 bash
    sudo mount -t tmpfs -o rw,size=512G tmpfs /mnt/ramdisk
    exit
Hyperthreading and cpu boost were disabled:
    echo 0 | sudo tee /sys/devices/system/cpu/cpufreq/boost
Please note: When testing on a fast multi-core server with a large number of clients, when the speed of creation of new connections becomes very high, even with such kernel parameters an error may occur:
    pgbench:pgbench: error: connection to server on socket "/tmp/.s.PGSQL.5114" failed: Resource temporarily unavailable

In such case you need to apply the patch 0001-Fix-fast-connection-rate-issue.patch (attached).
 
3) The server was configured as:
    ./configure --enable-debug --with-perl --with-icu --enable-depend --enable-tap-tests

4) Build and install on ramdrive:
    make -j$(nproc) -s && make install

5) DB initialization:
    /mnt/ramdisk/bin/initdb -k -D /mnt/ramdisk/data -U postgres

Add to the postgresql.conf:
    huge_pages = off #for the sake of test stability and reproducibility
    shared_buffers = 1GB
    max_connections = 16384

6) Start command:
    a) Start server (e.g on the first numa socket)
        /mnt/ramdisk/bin/pg_ctl -w -D /mnt/ramdisk/data start

    b) create test database and stop the server
        /mnt/ramdisk/bin/psql -U postgres -c 'create database bench'
        /mnt/ramdisk/bin/pg_ctl -w -D /mnt/ramdisk/data stop
7) pgbench commands:
Perform the single test sequence (I've got a dual socket server, so the server was running on the first socket while the clients were running on the second one):

    export PATH=/mnt/ramdisk/bin:$PATH
    export NUMACTL_CLIENT="--physcpubind=96-191 --membind=1"
    export NUMACTL_SERVER="--physcpubind=0-95 --membind=0"
    export CLIENTS=1024

    numactl $NUMACTL_SERVER pg_ctl -w -D /mnt/ramdisk/data start
    numactl $NUMACTL_CLIENT pgbench -U postgres -i -s100 bench
    numactl $NUMACTL_CLIENT psql -U postgres -d bench -c "checkpoint"
    numactl $NUMACTL_CLIENT pgbench -U postgres -c$CLIENTS -j$CLIENTS -t100 -S bench
    numactl $NUMACTL_SERVER pg_ctl -m smart -w -D /mnt/ramdisk/data stop
8) Measurements & Results
Before the measurements I rebooted host machine and configured the host as described above. After that I ran a script that did 30 measurements of init connection time per a given number of clients, average time and standard deviation were also calculated.
The measurements results are presented as graph an in table form:
 
Number of clientsAverage init time, ms1024~435 +-202048~1062 +-204096~3284 +-408192~11617 +-12016384~43391 +-230

 
 
 
 
 
 
 
9) The Question
It turned out that the results correspond to a quadratic dependence like y ~ 0.0002x^2 where x is a number of clients and y is init time (ms).
Here there is a question: is it expected behavior or a bug? What do you think? I appreciate any comments and opinions.

--
Best regards,
Alexander Potapov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
 

Attachments:

3BDBA-68359800-F-249DA480image/png; name=3BDBA-68359800-F-249DA480Download
�PNG


IHDR[5���/	pHYs���+ IDATx�����+y���O�NPTMSi�����kNN����3��==3�Rg���>��O����0�4r{W:X#��}b��J%����i�t����OuAAA&Pu�As��~9�y�� l���_�/��JG����?��/V���kL��$mmm],����],"����> l�[�����> l�[�����> l�[�����> l�[�����> l�[�����:8*�,��N��LG%'�����T	��.���r�W����.0�*9Y�R��f,�t���d*�I+j4��^�<z1�YY�Q"W�c��D^��+��SJ��F����~N�uQ���*9K�R����+�;������K�@�Tl�u�����i����}�:W��b�������r���}q�J%�u��f|���#*d�U�
_��	� ���������M��v~i��~}�P�h�q�$����e��}��,�*y�������W�)�,(�s��$�4e�U��{�>�7���5����r����\�Ty'�|�����YY�~�r����E6�������;��J�������l��i��|���J*9�����A7B�d��JD$UO5��g���[�D^���w�I�F@R�v��p��VURD��vd��C�=������]>�����`��}8�oy�zT:�r�;GGe[2w��VNL�l��&|t*97d���l�#�fd��$qg0!�N�S�\8�|>�n���*7!i�M�)sT�w��
C�fA�����
m����C�d*�=l+�6C�:o�tv������+�FZ��Su��mz?:��������:�j����e5�T���I�OKWEI=�;JF��Je9Q�s�;[����`K����a��z�����Mo�]���MR��l7����1�����C���`��6	�iURH�3K������]Z�D^���_BY5Y%g��������T��M�1|w�������{��)*Uw5���p<�|&&Sj��z��=����l&�?��������QL%;&�0�����-`npgpM�
IK���%����s�=��Q��:U1�{b�p<�X5�B)+k���*:*�VD��o3�wd
}��t7�1����F;��{��7[�f�������p���h���]���
UG���e���gBJ%JZ��>�����t�_Qw�"�t��'�?W�������TNtX��y����T=u��l�I�`�-�5u�(X�~qW��/��M��I�,e���M4�U*4j�kL�Q�����Ue���5W76�T*��F;�v��������C�v��%4�������l3�Ls��z��������Qx�6;���z0����C�hZ�hk���Z�t��I1b����������@�q�_+`������U�,�Uq{��j����tLj����3�xQ]�16��Em�=��u'HjtO,y�V<S5Y�j���K�S�g��;4��a�8�&s�u�f�L��FX4[cX�DD��h+�����:���gC�IYu�3��9A�L��.q��2	�5*R��o�FT�#eKU�tp���B(���j��qk���f������j*��������s�Z���_e����d��:f��w������q�������D%��:�������������alk�,�q�h����u=��>�+���~m]�g�k~��r��wA�dH�N1�*�F��j����������u��q���.��~v�S��D����@��v���f#LH}v=����>x�/��K%����u�6e��JNV��p�gxy
��#�{�)���>NJ�g��w���N;f�kL_n�2}f�k7fJ���%�NX��4��]m=���K<��-�pt����0+�u�������d��I�Ocv�����1K��T��q3"ks�;[��q��*�=;�ww���#�g�����k<���U����%��*��R���{#�H��+K)iY���a���|���2��c2��y9����d�������zB�5��q��hZ���?�����,�F}�Y}6���D$�l�v]��:���Im���}2���:_�g,�./�zYG-�+Z���{|�Su��}���r||\���
�0c���]L�;�b��]��899�!h�xhpYG<<wvTU��nks�n��%��-�����t�<C�������,�1\=���������|B����-�a|@�>�(gYJ�?����dY9U�PL�����R�`w/0c����~�Q��]%�q��[S1�T[s�������Z�Y�v>l�{���@_�b�����
fu�\R����i����lV�z��JNV����|{���,Y��\�x^�x�U�����qTrJlEyebf�U������-���)�t��u�)*�-�w�z�=sC�b-Xd��`�����2���7�I��V9(�VD�k*��R�����t7Y�-)��+�q���Kb�����m�{ugl������=bm!%�q)g)[����~�=r�J����{'����9:�J2C-�������M�u��.(��(��7���,��2����1�B��;n���,e��J��X��NQ�d�{{��lIm��z��)|3"�J:��nY���_m��e��j��KZ��� 8t#�/[��%�j�7���#�m����
[�����6JK9�u�����
"������]��)�T,s���nL����|������:*��]�7������zu����K���a�~�A���*����}2���TI�Li`���������[�K(���c.G���fL{�f�PX���{Q���E�T�q+������] ��uT�;C�$cS�k�fh{�l����*S;����UO�O5�B7B<	+����-i�������[%�T�6�t�/���R��|y�s*���y��~Gn�����B�+�sT�m�h����]H�*t�w��B��+#4���F��$zM'�;\�P�xx�����j�t���$�o�Q�D[�6��cT>u��tT�e����q�,�1�f������������T=h��o����������
���i�C�^��*����6J��;�����He���p��`��RQ�slV�XfL�#�����f,�7hI��qeb��E�s"��v���	j
'nW��4�s�1VY5Kn�qZ���i�up�v!lf-����oO�{�R�dN�q���.a�������W��o��|)I���J���QG�d�k������������:6�{��%������jyNV"�UvB}��hZ���O/E��gt�J�|�F�����d���G����gBJ%-]"S�L�����������V�u��899�!���> l�[�����> l�[��������e)Ut&�TN�e����2~���	��Y�c�7��j�v%���8��0+�I�k=���W����$��e���SIB	��a��bJ��z�+�zY�"W�_�/�����oj�$����TK�R��}9E���m/F�����JK��������jl����}���(�-�~�QW�7�z�s,�z�4�wD�h��IG������4����La��
E}�Mg�4m��#9��t%9�}���l����d�����*���`���I��nyC%g)k���r�<GY�M������T����}9qNU���H;5=�\R����i����lV�=����������>?�?���e���G��I���W�g��|?��t#f��H��JY�|�������z����lK���k�r��"���#S%z���k��_��x^��T������L��,�p<�~�8���)�tHW&��)j�$����?D�Ot|�WrK��Y��-`F�vo+R���_�n�����l�T�PR���x��7l�@�Tlo[�[��fG�}��O�0tjT��N��aIRD��h��J%V���h�uM
������9��PK�J������R���������~���LzS-�������e������en��p{[jt����f�Su5�sO�[_������k���u��R���Kh�x5��f��95��:o{�&����]o��p�
��<�6�y��67���������^7�����!�.<mv��METR�����������q����g���yG����X���s:��N����s�7����j�����g������;w��}����wj�>j,<�}��;�;W/�N?�������>}�}�����~�v���O���y�3����o��|K]�kP����~���-��v����K��8�t���8&���������~��o}q�k����������8��v����z�g��>�j����CW�7������~�3��S����r�{m1����{=\s��M���q]�^s��=?�y��<�=�{���a�mv_���}>��r�>gC������y�p~��{��&�����j����{���w��:>>����%�.G��������v����T�z����N�QYv�_B�vl��ft�!#�t>?�GU�},I8>N�S���_%��mE�������nhq%"r��u��jL�LLW�!{�e(���t`[���I�hd�����m5�
��Xo�Ux��G��lK��v�_��	/�y�i^o����k��>h������c�c}���1%�p��e�rxu'��
�T���2�%k`�a�p�s���N�3y�����	�H�gP�=?[F��Y���8[�L1�������4��_�-��:�T��x.3t��nl*���@'�V!9������`(dJ��5�qt!u���$�Z?��/������)�e���/]���I����TOG8k��j��=i����^�2��c���rNU���mc���Q�nA��^��\]^�� ������57���a�������1Mg3K��~6J��UKei/�|���;���������������g����[m������O��}5OQ�P�f�c�����Y ��fMxW1��B�@����w�\![�A%�x����-3�������X�_��r�[�u�D����C~:��~qQ*�Bc\����o!��I��?�go���]H��1�:���k$��j7�wd
����QY���=C��~*��;2s��
^��L�zkYov����y6��f�9�����m�U�+�����/��������;f����k�3O�7��d������F��#G�h}����������Y�-`���������7�f���k�_p���K����e,6�����%���������!SR�T���y���D�����/.�@��R�A�*_c{+���|7�B8���_>Wm�u�����@���v�����������=�����r5��5�(��<O�D����f�����gS�n|�����
���w�1��9�||�����6�?w����x��EqXB�f�w�"�!0�������*w-�/U��:����])����/I�����5�����t9����g3u%�w{0�|���X�s0���s�whW��n����G�N�n9On��Z�m\F�u|�k�M��I��^{v�H�s�����f���������^��&z�
X�����W��<�5��u���	}�4�������1�EP�����}�1���~|}�L��������i�N-������fg�w�!l3*��)[v�3w���b��B���zE�l��am�����:����/��>����z�=��u�J�;�����j����_{��Gib#~}��������<=�s�J�N��������rVJ�
�Z����nl����:8p��\}'��JN�e����_�m�����0�r�'���{�����5�n���Jn����ir�����>s<\��wX[�����>QR%�u{9�����c8�9�p|��x?��|��VR���P���Q�����A7B`VQ���J:��dD��o�d5�������^n���#����������!�{?��]���Q����[�s7:�#[Y���}�O\����-}'��TXh)���> h����>��b�|[W4#�VF)%��E��gt�J^�	
�����JZ����[���<9��������������~�;��H���s��5���&z�I3}�u����>�46�����1�3����k�����f2�r�>�^�=��0��}��_������s���N���x�k����Y���(V���k[[[A��L���[`
�� 
x�2f���	���k5�s��k����x��"7��a�!���Js2����u0plf�`��F>!l�[�����> l�SL��r�]H]�������E�'���> l��8E�,K�y����>,��01�-��z� ��p��e��:��*�_7c��F�����l����u+�
iKNQ�dA�U#���2��{�I�wP��j-,�P�m��zz���`����
��'����?	e����Znm������c�,�R�Q"W�}��lU�LZ�������C�O��2�]�����@�N?�|���;�;w��}������kw���=�|�V;�����;������=#����i�3��j�6m}���%�g�m������^���^�3lj���=��l O���qj��u6j���gj�o�}z|���Q�
��u||\�!`�D-w"�q%"�]>�#I���$����]#z[�*9#����_�"���]��{1�*��m���X&>`�Wm���	�[��k����-En^5���(���/��U�m���h�8�w3�R�������(y9>��\!lfHD7;��!S���I������u|76�T=m�bH�=�����:�����j3��.�B�T���la��G|����h@[��(�=G�~��wL���bc���J2��=j�^����W��U�:R��fD*T��w?���J2������NU�d��
�k���2�+%\��h:#��*4�����r�Q���y:�x�T����m��I����������G��QC���F�Z^����-[�9������*I%e���='A��{�B�&�����'���P4�WT��#
Y�B�z�k�?�{F��p\�|��5��r�������$����YP�|$'�Y�j:jB�p|�hA7B�q�:]qt��A��w��m*��+�o��/hu�%9�������wOA�K�D������bm�^�~���������M�|��~�{#nWB����u����zL��\!lf��B2�2��@[���O�mDu;b���dY��u���l+�l��-���H�l�{+�Y-��$�����V%g)5ZC�o��*^�U��t����g����X��,]�t�T���S�c<��4
����s<�a�e�c`���0C"JdB�OZj�i�Rc6��.[N1�d6�PkwB3���t�o[r��eBJ%-Y�G���2�ie�R�1�����QCNq���eNSJ��zN�u����A�#�'"*e��J�,)#�V~3'��-�w('���>��s����a��v^��;��0WV���k[[[A�Xr���P��i��Smh�C����>�prrB7B��pg��|�������S�c��w=�I�03�F����	utG��U+OW�e�|�.Q���!L��'�-�a|@����-�a|@����-�a|@����-�a|@����-�a|@����-�a|@����-�a|@����-�a|@����-�a|@����-�a|@����-�a|@����-�a|@����-�a�eC IDAT|@��]��*9K�R�kf,�t������J�`7�F���n�=�r��Xfs�$I��������K���2������fw��m�bu#t��/����!H���1�*��2��^�Z��U���6����m��R����m���a)+�9n�j��sZ����q�{]�.l��y������*���2�h�e����{2c��X*[[[A��	�����Pt/�r��#'����;N������������C��E��C������K�-��-#$SU�
�r�T����1�r/��[�r�J����9��w�#�5T���V��jZ��AA��nx��qKo����QRI�p�Z�3�E�	U��	4��2��4��.���e�r||\�����wO�n�
�,9�'`Vp-bpbp.����9�Fs��> l�[�����> l�[�����> l�[�����> l�[�����> l�[�����> l�[�����> l�[�����> l�[�����> l�[�����> l�[�����> l�[�����> l�[�����>X���sTL%U��H"�x�}����-��i�2JG����"J��
�h��r��Xfs���]BE�R��HB�x��S�%UPL�|T����R3,
[��
��n���������_2�sC�$�wc2U�a��r/m��4lUrY�"�����S���6[�glk�������^��c7B���RD�|XR�[I���f����T�iUR��C�{]�.lU
R,�wlT8�W>�����"�
)��N�B�NNN�.�:���Z�,�:0I��*9eK%�^����TN�u�D�|G����:^mmmM�-�:NNN�1�1�1��e������V����0k�4`�&#$Se�:R�9�����m_��
��M�aD����-�%����|<,9E�RE]MS��x� �1�����V��j�W�� ��i7�a�<�`�������m�(��U�z�����h:���2��S&���}�r��Xv+���5�'O��{�t�������c|f�"f�!f���899��n�0/[�����> l�[�����> l�[�,xt���_���L�z�������������Y�A����]��O���������y���R���������U�8��������.���?]!�@7B  �~�m��/�vq��z��7����o��2��0	�-  ���V��s���
=����\&��d���J�}��?����6��0Q�-  �o��V6^��`eUkO�[�O�e�Eab[@@V�o��������(�HZY��c���o�]O��C��aL�Fh�m�����������~7��?���w}�i�g�E�kZ}�i��Qmlm]&�n�@�.T��L8�20a�- H��u�����v��`�[@�.N����Cm<���K������z_�O>��7A��	#l�xP��;?&��]
&���>^�.�����1^k����[@@�_�����Ykoz{����-  ��w����[@]���_f��#l�p��������[@.�������7?t)�	a����Z����Z`�-`�.��;/��p���)����j����L����Zy�SZ{��A���);p_�|TZ���"���ty�����[�=��7U�������[���z_+�?�����.>#lSta���w|DZ������R������Xx�-`J��U�~�&�X�-`J.���������La�������Kk�A��) l�P����L��D[�\��T�?��6��4[���/H�7�����K����)�x���C�����K����)8�_���!l>����u��S��L��L[��.���5���CA��)��	�SIl)��+�~�Q"W�������:����}�����	�L���-�xW�PD���z%�TA1e�Q�*9KYK�04�r/�Z]<xA��~�e`���aE)�{��e��������$)����+X�e@��_�����6x������U�eU��V��X�Te+�����m��R����m-.� ��h��t)����F��_�(�Kj����V%���u��^�����d"���:���Z�,�:��������g���|O���.S4wa�rP�b�����t	Xr'''\��	\��\���O?��6��	����E�_,�����S������.cs��q�{]�����G��&��ZRs��.|%e-K�e���*I*e-Y��d�d����S�����4�_.y[�t���ZM�G�.���eD����-�%����|<\���V��j,W�� ��i7�����:���/h�������t)�����P4�P���j<~��)�nL�>�r���������}i��:}�����[��.K����\��\�����_��������n|�������qrr2_��yq���H��Zg���"l>��_���BZ}�-A�����?��
�|_j�-`�j�uQ�������KA�[��]T�"=:��3��eF�&����Z}������[���?��]-��I�]������	[K��L���K��w�@�&���}�>��V��t)a���W��S���]
F�&��L���6����0!�_S��L��@�&���
���D�&��A��Zh"l�pq���|Y�|4�J0#[�\T��������t)��-`�_=���Ok����K�� lp�j�����Z�#lc��?��w���g�B�+�-`L�����\�|,�R0C[��.^=������������EB�#lc���J�������.3�����~Q�|��w��.3������#����>���K��!lc�x���Z���\S��?���
&�@O�-�����j���a����\��+�Z{�{���7]
fa���oI��t�Q�-�.�=����"l�p�������w�n��`F��k�������i��k�.3����V��+��x�N��`���=��]���x��Z�������e�<���7�t)�a�-`D��.k�����Z��`���Q<������NBA�FpQ}I��_i�]��8�0��o��V�|Zk�e]
fa�����x�'����K��#l�~�S]����-`����+G�j���'�-���o����~�����K� l^�j:���������wt���i�]�-xC�<8�����Z��.s��xp��/j�����Z��`N��!j�u���������]����R�����fL�tTF��J�R���3�Q:�X�Q1�T��@D�|\��
Y�u,����j������9[��w�����6$����U2��|�%�D�?����*(�L�
h�����fX��KX,�����~�Y�>���K���n������7����ow��/���]�	��d������^���9�����ja4s�:8E����M�����l��i��flk�������^��B���������|-�l���k�V$�WW��RVVs���x*��*)���!��������D���u�Y���Y�u�^?�=���^=R���/lQ�����,KV�$�x^�xcew"�l*�L:���mmm]����	�!f�"f�!��E�?����k�w������e��*�x""�e���g(��Y_nl�#5l��u� .�t���t�=�L��<lI2B2GZ����U�����4�/�����w���Z�-\�|�-��T������x� ����1`y��;�����V��j���AA��n��ry\���%�����q3�R0��k�������U�z������v�l_���-C�tBU�e���"[�u,��o����]-\����q����w��=��u+�2���Y���Y�u�N�?>�O�������Q��9�mr.����9����T�Y��{����Q��������������D�X6�-m}.���yj�}O�ny�m���z��P>�o�@�h�z'���%m<�qi���[��"l,�z8R,�|��P%g)kU����a�e=�mUrI�w2���/��fe�c�2�J7��jl*��N)�������.^��^��I�6��7_����b��e5���2h���,�{-�����"�Un>���z^����|{����b�����Z��������}t���j��c!l������H��R��t�]�%UPL�|^�|^�HI����Q������Y�
�L�.���e=�m�bh3���,�c�*�Y��\��8*�-kg��Y��O�����[�O���-a��fI���������Tm�6;"�S�~�T�%|�wc2U�a�����*u��?v�
H^���VO�N����[w8�DD���X�eURD��n�nw�=�>7F����/h����yCXt�-�Ur�w�$�NU�k���V�w����b��,�R��n��&�*[!��c[;�T=�u����W�����z��H���b����U�JN��I4&�p�����3���u��S�xa�a���oF�RYGN�~W��Q������������I�t^�>�:�UI�>Kg��X�Lkp2�����,de�$Ej����3�IY�%?�??��<�z��������A��[xW13����h����1����]�YS�%U�M�2�����mE
Y�$En�������5-�'_���?!��Mm�XLt#�����9i�sT�=�����j!�����c��������`�H"�s��;N��iJ���.��P{�K�?xA��'l���0F��"vA�a��f�3B2UU[�������B��\]3v�������/S���W�Gk9E���X�vD���c�E���o���n��)�1>��T�u3"��I��nzx��P��vL[����+�x(w2��4���8E�A��-�1T��v�v�������d����Z-��v�j��������O�F�o��V^���n�1[S�N�Q�"75���N��P��O*!IfL����f���	��Zj�EfL�|�{������
���v�j����3����q\�xB�RV��������.uv�=�	k:���[9>>�mmm]���w��n��tXr'''��?f�"f�T�C��T���L�1K�E������?��xAkO�'��<\'''t#��IM����V�zZkoyw��`A����l���'��/������"��]
c��b�����}_���X����=���;[Xz��_����Z��A��B���;;�km�kG+�7�.����V;���_��6����K��!l`����%���6�>t)X0�-,�����������o]
a��v�����!|A����8}Y���� l��-,��o��V�����~W��`������W�]����K�"l`)]��T�~�-m����.����t������������K��"l`)����l����K��"l`��~�S��/��s��.����sv�7���6����K�#l`����6����c��,0��J������E�x/2��[X*��v�km<G���[X*g/^��h���]
a�������J7~���K����q��U��O�A����4����i���h���]
�a��V����gbL
aK��{���O�^7����.K����p������[�����K�� l`)�����,�+|�tp�`�=���z���x�?
�,�������k������K�!l`��������H�kA��%B��B����}����?�,������������A��%C��Bs����6�.K����u������/��� l`a���y�<�:��k'�R����.`dNQ�dAv�g3�L:*�jSI�+D�����r�� hg_��6��{ZY�t)XBs������+mHRE9+�dnS��u*��
�)�wX%g)k���]�e��������'��L��`I�Y7BC�tZ��m��nFZ;E��L����t�wc2U�ae��l3����ke�qm���A��%5ga��S�~I����Or���������S��:�/��
����?���Oie���K����n���I�od����P������:��/�A�^��]:�R���/lQ�����,KV}��ysrrt	�!f�"f���x��_�uk�W�������&�x"�R��#'����;N������������������3�k���p������s������A�2�b��1[�d�d��UmC��#�m)�i����6����H��������K�������Ju�s�d�;�6T���V��jZ��AA��nx��q�������c���T��`��W7B#��!KI�p�Z�C�
E�	U����������}��ud��x��`������\�Y�*�|�p�L�KP����[�n]��0+�1������������;���
���q.���?�::���5�����5�%s<�s���i����2��5lU��+*��s�������T:q�r�������Si�F��~���UH�T�H��-)��L"\��T���5�o�.������nF$��-��������*������z��g���������.������xB��fL{�F����`���&l`"�^�����&�����X\>_�a��y���L��|[���-��O���K�����@g/�W�����0?t)@a��V���>��#i����\��k������n|��]
���1[����
v��%�q1<�����j�M!������w�*�AAKL���\^����������t5@�lUtX��XF�(�
�w���.�C�b&�>f+�I��?����Z{�sZ��w]
�����n�Ti�(���`I�.�t����1�jaF�:A�M+Q���
�W0c��������O�����t��t)@O�v#t�)eKV�������}��h���i����.���	2
6w�0q���Bg'�����5�R��|� #r����:{�s������+�c����/��n��������.��	20W.��:��'�l���:f+ge5h~���-xu������<���]
0��a+�x>���������?s�{_��` �'�&�������������K�"l`n��������k=���K�"l`>\>��K�������t5�P�-���o�u���!�as�����w|X�o
]
�	a3���_���������5���\�b���<l}�}�/T�t����3 IDATt)�g��r����g3m��RE'�R0������{_+�y2�R��Fh(�vC��[�v��U]�/������KFP7�N���#@��gZ}�����O]
0�	���(gY�U����e��eU,������u�C�\Z]�`$S�F8BZ\�/����z�#�*�R��1�;f����OZ{�{���{�.a3�v�k�}�s�����e��R��?C�E���c�Xg_��ju�Ct)��pg3�����nl}J��{S���2�;[�����mK��'��_9�w�4�R�k���l�W�Y�v�m�$����#E�����������Z5��e��~�\��g����,������������&����$0��-*��k�u��������5�����iv���� ��d���
*b9����|l8MJ[h������ss�4��sx=�<�����?�^���������o�2�6u���6����:#�lnRGx���oj��-8�q3k��0��U-S~��<��|���?��|3��m2�����R�K�a��45��o4�E��~�O<Weok�m������0j���Y53��,�C��73H��TsS��kU`�7�N��w�cC����xT�r��%���At������AI�B;��z�
w*��9<��5��zzP���)�R��z�W*>�J���*rW�{�'����l�o`�W{�.��aIR���bO�IU}�������y6��nRWwD��8�joS��S�V�������w(�m<��%)��^�UW;�XOCK��g�Nmz�%�Y5�M�j�g�{6���z�"�gy�7@a��R���*>�=V�,��d�k����a���Z�$3!36��[��G��w��u�i(�R?G�igP�n<��!\��QX��l�-����w�<r�����������p�RD�M��7�~��V�,I�������C[L����_f<zx�i*������3c��tnSP^5�M
��?e�v�u]762U��Y����7����y���So�X���=���+,������:�;��s�g��������\s6��~N9�P��;U����`�2>	��P�A�t6��c������RSO��>�fm��M��zkZ�U����\�j	��=�M�9��!����W[����U�����������a�b������N2M9����R�%[�i���Z}r+�6�_~�_����:$�L��2�f�2l��!3�Z��T?
4��PS�����W�j$�TO	7������.j1<
Z�s�7�0������W�?�ra��[s���F����EC�F�UEg�]FI���K���l���(��+�;��N��91��'���3/��,����.�Y����[��6�)[����r=Y��+����$)��ayc40��I�K�Y���Wb����=�����.��] ��0v����T��x�WU��V��Z���Ur�{��s�d?z}���,�;�.�SE�����I���mI���Hg���F�R!�]W;��4��
�����p��n��%��mA������%}�V��T����.���q��7S�6r`r��N9�y�
,5���]��)}s�b�75��-�k�R�4N�2������B��V�������v��.�jQc�_~����Y\#�3u���1�y����=�6s<��@�G5��oTr��%����L1v��en��a��j��m�Y����9��.;v���M��.���G�������l@?�V��?h��Z���������0���,����Q�4WBKk��jn����g��j��m�]����?�����/���6H���U����Z�?[3BH��w���Ku���������f��y�joR�&�������DXZ�=�}����dp������?+/�z�b�u���M�K2*�ak��i�]�1���z��L�z�W
�F�t�����[���cz6��vhg�A���4��Yn���!PC����7�`�lk��p���e���������H�������VZ{��t���%}���r�6�������~�=��mA��8�*h���"}��j�����n��Dw��d�>_���R��[���3-��k;�6�eJ��4h��Ms���k���}7�������~��A_D6�����*��s���Ai/�?�K���P{�:�^5��w��K�[}�j�Rw�^����H�hOw�t��'������Ed���K���������cy�%�����F��#��Vjy�#Xu�U#����<+�w�+,�lq-���>����ve��<}����"�d�X�p!G�@��A+�����)��j�%u�/W���aulM�o{��n�6{�hW��`~�xja���#����X��@���RPm����ir����&�d��{n�T���^��4���-���6�O��J�W�g�������k�����u6_+mmQ=�c^;v���M��.���-��������g$�]�W�[]JV��������FV/����_R��?����V�,+koj��3��v����s��V�,+�V�����F��9{" -����m~���%
L��?�P���.Xv��l����]��9��6�*�Z]
���ed��P�����S��>�������+�k��"F���~��r����`E�����C�>�_��0�.X��B������,��;%�C�o���R���k�<j2�K��dR#���J��VW����@��=T��>_���`E���Fv����ke?z���+���e����b����:���+��,��:��j�\�m�C��7wr���R���vV��y���Y�5�rn���R��,75�A���������
�#���wK@�4���]��1� �x�X��:�[����kU��M�%L;�=O��Q��:�����!�)?K�]�����M�y�C��V�L��{n�{^7��j�R�����l���>�k���o%�������vB��V"pE���j���VO�j��Y�Ff�R3��TsS��kU�����{�<6����H��[�O@��M����&��3(���`p�B
���a�[�����8��Z['w��h��_I2U|�{�.�o1��l��-w.���Hw����[<��s�����
C�m
�}jm��=[�������E��+��j'�i�m�l��wj[���
��s���g���z�2����U�4�	�(��H���|�_�(���������Zi�"N�Pp����8���eH��C�c���;��k�;w��insM3�����SkK�D��t6���n���Ez�R�����"�
K�K��#�i( I��YZC����G8���V����R���E���n�G.����XhZ_h��r�W��)�6z�m}���L�u��������V�X&�a�7�"�g��y�������]�'�`uV�m@��O_x��vu���mui"h�4*���4C�F��Rw�~�������r�m��W%��^�]�@������j���F�M�)s�V����������M&���E����V�z��j_�T�����o�����c�:7{���3�y��qqo-���{���o���
����$�K,�5[Xq�����+���2Rl�����}�I���!"��
���:�����FoPm;Cj�9���,��I]����&_�u��yF������50cTl���ZHX�5�
��Y�uQ�z����&���p�0��6W�������i�K�1�b��yu����>E�!n��x�)���������R�-�8�Y*�Yju���$;���j�e�����-���#�j�����V��^��R�]�Y�VZ��CS{�E�j
W�j$�z��I]?����u��S��iL+�tw)����3��H=�����F��m,l�e���d?�T�|����Z��l���j�Tn����Y�U#��43KDz�Z�\r�o���M�C���
���e������m�x`�e��Ez�=K��l<�.4Z�����S%#�jn�:esy�w}���W}�w*�?-��h Y�a���"7�jU�N-�0!�������JR�)����j��C*.U��_4�\�p�B��+���'~���'��F��t6�?��������?��v*�Y���������=�����Q���u�I#;;d+]%�9����r�2��r7~��R}K�z�s\�5��B���w��P�v��R������l?��
4o����Hg���,�n��C�����V����������p�����/��{�,�J-�8�1�x^f�:�6s>��<�a7D��dF�4��K�\|����r��v�27lX�d+=��HV���9n����i��e`��Mq�[h��H���z�%��r�zzz�����B�O����l@?\��������i�?�.�|����$�a��������J��-���-�\��K���T�_���y ����7���w��1�F�����5�K�[��o��f�r."����_�gA����.5��|�����Y=dZ��J��[����Y#���.�"0U����l@?\���}L���T������4�a�������V$u��W�����r^��G����>y���Y%��l��['],���F�7�q��r�x���Y%�#[5j��N���^Tt����`+71f`5B���n����<�-V�d��H���}��*��j��i%0S��.���L���3@a�? [�j�{���Y)�oA�T����}��~�������$���r�����-��[���9�.����[�VF�r���!��k�ou)@��p�������A�\f�F4r�M*��+��V�d�e
[��f5M�����F��FUr�UV�d�e	[�,�<��i��T|�f����� �e8lE������$�O�-�re������+��O%���.�z[��Z�5�;���@�;�I��{����R���[]
�����\�WK@��O�Q��a�\�Q�KrB�G�<j�����j���{������~�z��r��#[�	����x�G�o����9�����������6\"���[]
�3�o5�t�@@���R|�c�����.�)���a:X  ����C�|�'�ku)@Na��)~X�B����.�9\��9
��C9���q�V���f�}\�g�W��O[]
��2<�pD:�����K���
4x�n0c��
�d�=�mr����Qs��N�hu)@N���R{S��Zjq�}�oSsM�Z�Sk����!�Z�UC�~��5�����1r]��I�z�U�G����r���c�=j���5��F��[�0��mA�|['���l����v�2���1������Q}��N���R���cak�^�U���7�r���-��E����1r\<��b��U�e�����"����S��"}��o���t��e#;~ �����KrZ�]�5UD��v(�mTK�^(���cu	�Y���l@?�����5O��C���W�y��r����a+�����W�S����f��,�=�m��a����8===�Cd�"��0�����t���.� S-@��/99�0��W[p���]5r�W�.��t�+,�T�����1rT�Z�{Tz�gZ@�\��3hIcU���}rY�����>m�d�=�c���?}/����2!���-�!��Nip����z�K�-����i���Sk��2�KmOw�����b����I��]�L�'��;vh��MV����	��Ed�B���?������>�c���
��������F����R��.����- �[n����q�*Z_ku)@^!l��s]��R�[��Q- �[��45|��Ut�Er�t���y��P��O�P�����Z2��P��I
��;r�q��gZ]
��[(��J�}�Q-`�
M"��?~G�o�K��9��j��E�(0#��������~��R��F�( �������J.�+�Vgu9@^#l���o�b�*}�'�.�{�-��|M#����K?&�|���y��P Fv�@Fq�J.���R��@�(��/i�{�J���R��
a���.��U|^����������+��Tz�V�f���`���ij��k�p�'�io������X�������Q2��

a _%b����<��rT�iu5@�!l����J����7X]
P�[y�:��?P��W���eu9@A"l���?}O����7��R��E��3���k���*}{���r��
a ����n�F�cN����[y$�����_����d�T����"����y��r�t������'F��<��������a /$������K>&����.�[ya�w�%��J%�~��R�!l����(��*{g�����0�����	
��?Tt�Er�q��������F��%����w}Q2��0a G%�k���*�����;��r�@��QCw|SFI�J��i�K0�@�������U���(�Yju9fA��5���nkQ��K�<}����a ���%���+��E1�,F��!��/i�����������r����+LSC�}C��n�\t���X��������+�B��>u�d�4�v�l�s��ooUq���8�l����@��M���������Ha ��������V��_�QRiu9�D��bftX�����g\&��ju9����������*{���.�"��T|�c��&�]��*����D��F��o�W������VW�����=�+y ����H�au9�a �$�<��{�S��[e[Smu9�a �$���9��T�F���X��`��=�)��U}�f��}q ��l�
���t����z���O���kU��Fu67�#<��Uc�A���jOw��I��K�w�He�N�u'Y]�%���R��M��6�6*�0{�	�7�C>����X8�k",-���>-��-_���,�\t���������)�����'�b����[����$I��>���P�����}���^T�{�*�r�
�,r�7��P�e2�,J�Wa��z��]��sK�}������"�#Oi������@^��i�i��?1�p�z�H_���9�P{������'#���~�lA_D6����V��e%�>]/u����7�.ly
4��Z����F�-�V�5�
6X]
\OO�Y���l`U?��kth�V}�;:�{j<�x�/97�pq\����;�������Dj��t�HG<��F�����h���@���5��Fn�j��U�nu���j����� 
ftH����N�X���Y]�e�_a+����NM���:��P��%u/.W���aul�\60��Ca�O�=i�+�m0��o�H�>hV�`��5[��f5M�MX�&�:$yj���NMj�wL>`�=�\�oiT��n�Z'V7\�=�m���O���T�����r���X&��]�L.J^y;v���M��.�E	�-���+����u��r�|�*���e?r������'��d3��`��'�*�����2��i��j��[�u�*?�=%�V�`�1������U%DE�k�.�
 l,�DL����lG����}��j��,��������U����pZ]����2������nP�;�d?z���XA�-�eb������M*����r�0��r0M
l��$C��_�����0��X#;;��OU����UV���ldX���5��o�t���8�|��`�@�����/�q�9*}���.���F�)���_��2GT��I6���a CF�����W����U���c!L@�� IDAT@$^~Z���O����*:���rd���������9[��������-��0M
n��U�����L��-�%	��h�����e�Xku9�#[G(�B����Ve������.@�!l���=��/�y�e*���V� ���G5ps�l��T��k�aX]�,�5[�4���Tb�������(.��Y������4��-���5��;��rd1��)~X���w�^�7r�q����r�-�4$����Mr��f�n������-���a���y�kT���N�,�k��c&5����<�2bX��<�������Q�G�#�Q'X]��8��������S��_R��Z���c[������M%�U\���r� ����v�?�9�p���h��9��
[2�������Y���������d[u����u����#��`������R,�U��^����W+36���_�����0�(H��{����2�C�$c����a�_�%�����8y�qqP�Fw�\f|��������|A�a�x�SR29k[b�K+\
�|D��~����<8�m�ke���[� _�W��yxCQ�J/��� ��@(HflD�$�n�QT�d"!�L_|��g_auy�a����n�;9N<W������R������`BC�%yp��o��l��S����Q\��S/R4��� ��f���k�����p���#��Q\nuI�#[� �#���d������2�V[]�<G�y����g[�����O]�tA+�i� ���Q
��%��U����~�	V��@0��W<�����iU}���}��( �-��q
��Y��C���we?�t�+P`[ �$���{�~U~��r�p��(@�-�_�	
l�g�z�U���������@�b��?�	
��U����*��o��X]������n��bO�QW���N���".g�V�����[������D��������^5��X{���3-h}KE�l��"���R��M��Z���!�Z�ri,��5�����1�
"h�R9w�V��MA�O��>�g6F:�-��ok*I�g�On�3���t�VN"��_�S*h}��	Z�J��-OC@����3M�Wa��zj��Vun��/���t�VF"��_|I�]w����Z]L�������T�l��n�������X
�!�}�a$b����T���:t�����j)}�~ ��*l��
6X]
\OO�Y����0����?(��iU~�{Z{���/�����_�*l���qZj{����a���g[�x�U~��rT����`N9w���\5r�W�.��t�+,�T�����1��0�����(���>�C����ga�Vu��:�O.����������s�q���:t�_+��W�������juI����F�lV����n��C��1��K�-�����?~#.�O��.�=�m@�$D���J���O]/�j���
��]�L.]y;v���M��.����-���Kb�����ge��Q�����b���~�l@?�===y6���x�:t�'e[�R�'~��A�ad�������-G�Y���;2J*�.	���J��������y�[U������K�#�sd�<e���&
�����*���I��]�-`�dRCw\����������{�����������eE{�S�_��y�V�A��1��?�%^}^U��'�ouI�1�-`�������I���>}��G���$�(�:+.�|�������R����� /���}�W����*:�BU~����@�b!X�����V#��D%�|Te�oeiwy����9:��m���3A����*>����`����J�����>���k�����p�guI�"��&�\�~�*�^�U�3������<��H�F
��Z9�����+2�J��
Vad�������T��[U��Z2���G�����~��������wTt��V����-��'����DFq�V}&@�P��K�j�������U��*��Qr8��
,G�G,y ��������U����y�;�.	�a��wj���d�:NU��I�u'Y]d�X36����i���Pq����IFQ��e@�!l��%�<��_|Y�C����!�Y�[]d-�X�ijd������p��U�Y��.����F��J������*��N�n��J��)�f��,�z�-0�����m��QZ��O�X����$��-ps�����>�;{���w4�p�Y]���&�s�;�M2MU~�[*�p��%@N"lI�9�������C����w����Q���� g���O�IC�}C�T��k�<�2�+��G���%�k���W����s�T�;�d�1��@����F�MCw��(*U�G�U��VWy��@�I�{QC�}C�P�F�J�� ����� ��(f<��{����?����U����Qs��e@�"lPb�wk���+y�U�]�U%u�lv����F� �%��i��6E�CE�]���~W���[]��(����
��]%���S���buUPP[���K�h��-J�}^���U��O�p�Z]�y"9�_����F��������������`��u��Fv���?}_Fq�*>�r��v�0��
a�{�KC�mU�����~B�����"l������m�>}��N�T�kd_���,��-r�92��{����7���F�����p��efA� $
�����+�I�]�����Kv��@���lf�������K��v�d�U��O�(���2�[d�x������9��VU��)���.�&�Y&�Z��������^��Q�'����&��,a�,�����?���e_S����y�e�/ra����4|�
�����J���Y���K6�������E��A������T��U�������(*��4@�]�
�����=��U-����"�lnRGx����@�<[/���6���itg���7J��J�W��"���r�KdP��-I��Q����O��I��5P/����_ai��t��l��A�v�R���D�����C*�~DF�*�K,����H����mM�$I�l����v��hOg�`�h���t�����_�^�n��J��w-�c�zV��]S���U�[���,���>c��]����+5r��UR�E����?'�l����Y~N#��?q����T��^I5s>l��t����W5��?�hh�ds��"�J�>�(��[���
�_��hk�QkK��e�������!�F>�E��>�=y��/�+��R�gm���&��T��G��K����y��s�~�O]M]�����z�)���n��
6dl_������"+�t_4M��j8x�b���}��*��/���+%�����9��7������r���^M��*����TS�Z�=�}
C"�������]�C�Z�p�*>t�Vm�E�l&h�,lE:�����Q��
{������,���>�l`h{��n�6{�hW����9tP��\�mWj`�Wd;�U}�U}�z9��L����V����i��Z��IM����M���K�-���OY@��Sk��2����
 �$^�����}�v��T��S�����W���]�v��O^y;v���M��.���-��/���bO����_*����s�J6��<�]2�eV����~��B?�===y6�@$^����-}�S��!9O�L�����{$���<@� l I���O��h�����lU�����*>�^��c����[������F�U���F�p����U��M�
�J6���raPp��}�v�>�+%^�%��j���U|�{d[�( 3[��`���������Q���d���<�r���Tt��������"l�W2���!E�]�'�(stPE'_��������(.��B@#l��i*����������W��������|Z�s�![��VW(�-@�XO�A������Wd_{��/x��g���G�lu��D��&3����}�NE��S��{d;�F�s����.�����'�R�-@�H�{�!���K�'�R���G���s������Y����V��]����Sg]��G�K�'�R���e���ST|�f9�|����J�d%�`������^��\'�^������F��F��N�9��X�}�>�C�g�2�Cr����K>��7^&�Z��?"lV����5r��RlDflD�����:������,�^zX2M��U�_|NE��E�*n6�-�-�����eF�o��*9<���_S��Ke�T�|qda�b���b�����������S�<�]+Z���XV��v+�s�b�{!$����!%��mk8��8v�U�y�-@F���_| �z�J��[Fq��N���w7�h�%}�6��������r��k
 �[��1M%����3�����+��R<*������oU��K�8���h��R��2�i���J6CIS���T��O�*�Y���9�-���C{���p�\����(�P�����T����h���/�I%�~\��'����N�{�g���,3�`AflT��R����?�S�WvI�!G�9*>��*:�"9���l�E����%�j�b==-@�!l��)���b�w+�BH������;IE�lT�e����2������E�L��P����/="36"��cUt�F���n�|!7`[P������S<���/>���Gd���U��c}����E9�{d_S#�����[P���)��#�����G���	�V���.P��_��}��G�H� C[�o�I%�>��K�*��Q�_zX��vK�!��'��>O%u��}�l���r!l@�K��U��q�{S|�cJD����,���L9��B��$�	g�(���\
ar�9t@��'�<�D���=�d�������r���������sd?�T�f��d
a�Tr`�/�R�����<�x�I%�,I��:V��3UR�!�����u���
�+S��j����J�yF�Wz�xy���(9�_�d[u�����6��z����e+?����B[�RLS�C�*��%^}N�=�(��Y%�� %b��&����8�4]�Q��;M��7�(]eu��� ��	%^�Sr��J�}a��y%�� stP�d�<Z�cOU�)U�����*�����iq� S[p$LS���J��[��/)�?������_J�TI�U#����8���^��^/�1'3Z@ l�\q%�I�R����k�J������n����v��G�(�:��gl�m�;���$�����X���`������(y�%������|=�����"J�#�II�QT,��d_{��N�P��-��=Q��'�Vu�d��:��� ?%�J�S���T�:�G�C��������$�F�V/���e_�V�)u��q���:�Q~�d��< ���36*����^U�����c_z5���J���clke[ulju��d[u�l��K}�>N��5�)�Q�-Y������d�������J��M��}�@��W�����T��:F��c�8�4�N{K*XU;���^d�
a(T�)c|����*9�������?�y���?����i5�V�Vy�lUG���X9j���r����'����(�f_��`�[@�I�5�����:*1��U��7R%D����C"���A�C�+9x@���J�.s��T���| �F��=�p8eT�M�FU��m�[��.��b�����U���r�Q ���3���+���d�FdH2����i9��6�C�> s���H����}�a�(]%[�Q2���V~��m�Q��w*X�}.?J���k�@A l�.��9�/s�_��C2G�N}$����9|0�u����>%)9}�E�����NFIE*<���Q�JF�j��:!��V�(_=�y��vL�8a��i�����9:��<�?������hK����H�������0d�T�(����JF����%�d��2��SR�J��U�)���(�-�H$�2�C2��2G�d�N~De�L���X�������db�C��2�+�BR��G��U��VR56U5���J�&�]1�Mv���������~<��m���
a�!�?��)�����G�|���h*Xi����9e�B��L*.���BFqE* �>>�V\!��,������������X${�e8�e���6�b��kO��1
a��4e������4-�OD�A):$st,DMISU<:���g�g��hRy*9�S��V?�6m��_�#{��Z�*����ol����"E���T��f��0��=+�S��A��k�+!%_;U��j�.i���P3uh<�hF������5�-6,����3��S�f" ��>;�R���=Ar�Oo���\Fq�����e8�ju<G��Z��NE��K�v�����r��m2���.
 ��VP��;5x��J���XT��E���[eW~i�G����10��������5r8'���Pd8KS���v�F��G�f(�o���tY���t��/����3U�a����%��
I�kp�WeF�%IvIfB}�7��;E�u��v4>�n��u��d�
N��m�B����M�&7��Vy���re����)���C����yJ��8^!�o�uQ3:��{~$��r�=�Ff.�=����,�v����*�-�`�\'{I�X{�������>���{l���������B�{���:���~
����ju�U2J+S�yW������X|�Jv�R7�a��D��������^5�������Kf"~X����Z�w�dD	�#��P{�:�Sk �@ �FoPm�v��yLq��Q|xCQ��.�{��g[�����[���r�}���'���9O�������@��.�2%%��T��jR��o^����.V�Wa�h�k��\��sw��/"y\s>��:C��p��"����w�X��S�l-R��wi;0��Tk�����1��-�i�&�����2E"�K$�����6l��dak�\�5���M�2�/��i�����[�����W�[]a��z�����b�jU��c������
�}�<����.�K�-�����������������k��Ex�9===L#��@��e@��e@��e@��e@��e@��e@��e@��e����|j��-����E���-u67�#<��W��y&�;������F<:��~����	
���h�~8�v������m
N|=[����B}qF?s���R���lf_��?�p��z5����a��Q���W���_3��a���;�yc6!l-���?���I��5��e	������/VH�M]�k
��5����V�����t^����������p?��N���E�������Hg����U�I.f���j��D�z}�
��4~���^=y";v2��m���y���o�B�0���(4�����Q������~�����7f�.A��MA�O��>�g6F:�-��o�����>����$y�����G�R�72�(��!�6o\�9l�~�`?7_?��7,y7N����k2�� �������
��-����-^)�M�c�9��Cao#'�����W���^�����f�~��^�\�o9�_MZ��a��
ak	<
��2&���jT=��U�:������r��MA��k������g����N�Q�����������k��Fn��:�
igp��p��_����=�i�����j��_�Nm��}��9o�>L#\&��^c��$GIDATI�x����3�{^5RS���Gi��4����U��&5�;R����@?Z�/�j�V��un�g���H�z�V��f��&�j����-L�������L���fJ��k�5[3��J�_s����}d+��,��}��<����5��\�������Pj���i�~����Y�[]aI^�|nI�6��K�)��z��WK�W��&������]36
��f��@�cl{�"�Y��UZ�p�@G���B�����^-�m�F��/��H�����7f'F���b�i	�7�#�Uc�������W���Ezf�G��t����m5��v]��P����
8�@Z�(��DO�����#�jn�j\�\��q���=��s���<�VB�y���N1��n`6�~������`[��#��W�������a���������"k�	��Fnui�����5[�,�������2\_�����3V�i�O[����G����Y�Way�e��=�U0u�
'�/�~��k��k�nR��0
��t �Z�E."45�q"N�'��qq���r&T���An~��T���gf��F<���=���}���5�<����h\����_=�W������h4Y���?��k��.~��������f�5n7:9cMM��M������=m�/	(*��W��5�g���N4���r4~$�B�������5��4�-L��)����FE���iF�b]�WqH�������;���i���Y���M�_��7~]�^__�><<�%\�[e2�b���LJ����fn����~������>qa4��+7F��AY~�^N�����������ti#<�4��Gu��n�Y�;.%�����,�4����w�b�*�vW�a�k7�E�=a��uq[�V7�s�����-��g?�p���3z\+�2c����9*��I����)��n.#4��i��=G���xl�a�����=e�$&c�m"8��x��x�&i����N��T5��l����v��)nv�[�4Do��0;���]b���-���<��):� ����u~�����\>�||�K�b)�smV^���Y���d����q��l�^Xr�r�z���}�&�{�n�I�����"�i;F�Wt��k�/-7������U�*\{�wuK���b�h�J_�����/8
���<�d�Nj�����-w��|��Z()��j�<o0����?��%?��b��l�`��(�Q0�h��k�)
sz_���u��������-����dz@�= ���l@H��$[���R����l����#IEND�B`�
0001-Fix-fast-connection-rate-issue-for-v16.patchapplication/octet-streamDownload
From 9206625663b2721af888553ee467b8d0f980f9c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9CYourUsername=E2=80=9D?= <“YourEmail”>
Date: Tue, 15 Oct 2024 09:32:12 +0300
Subject: [PATCH] Fix-fast-connection-rate-issue-for-v16

---
 src/interfaces/libpq/fe-connect.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 6bce6f647b..99cffa06f6 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -3040,6 +3040,7 @@ keep_going:						/* We will come back to here until there is
 					 * Start/make connection.  This should not block, since we
 					 * are in nonblock mode.  If it does, well, too bad.
 					 */
+retry_connect:
 					if (connect(conn->sock, (struct sockaddr *) &addr_cur->addr.addr,
 								addr_cur->addr.salen) < 0)
 					{
@@ -3057,6 +3058,12 @@ keep_going:						/* We will come back to here until there is
 							conn->status = CONNECTION_STARTED;
 							return PGRES_POLLING_WRITING;
 						}
+
+						if (SOCK_ERRNO == EAGAIN)
+						{
+							pg_usleep(100000L);		/* wait 0.1 sec */
+							goto retry_connect;
+						}
 						/* otherwise, trouble */
 					}
 					else
-- 
2.39.2

#2Потапов Александр
a.potapov@postgrespro.ru
In reply to: Потапов Александр (#1)
1 attachment(s)
Re: Init connection time grows quadratically

Sorry, I forgot to add the table and graph for point #8
The graph is attached. 
This is the table:
--------------------------------------------------
| Number of clients  |  Average init time, ms |
--------------------------------------------------
|            1024             |        ~435 +-20               |
|            2048            |        ~1062 +-20              |
|            4096            |        ~3284 +-40             |
|            8192             |        ~11617 +-120           |
|            16384           |        ~43391 +-230          |
--------------------------------------------------
 
Best regards,
Alexander Potapov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachments:

init_time_2caa85f4aae.pngimage/pngDownload
#3Matthias van de Meent
boekewurm+postgres@gmail.com
In reply to: Потапов Александр (#1)
Re: Init connection time grows quadratically

On Tue, 27 May 2025 at 12:45, Потапов Александр
<a.potapov@postgrespro.ru> wrote:

Hello!

I ran some experiments with pgbench to measure the initialization time and found that the time increases quadratically with the number of clients. It was surprising to me and I would like to understand a reason of such behavior.

Some details on how it was done:

[...]

It turned out that the results correspond to a quadratic dependence like y ~ 0.0002x^2 where x is a number of clients and y is init time (ms).
Here there is a question: is it expected behavior or a bug? What do you think? I appreciate any comments and opinions.

Note that the value of "initial connection time" is based on the time
it takes from about the start of the pg_bench process until the moment
all N expected connections have been established, *not* the average
time it took pg_bench to connect to PostgreSQL. This does also not
exclude other known measurable delays (like spawning threads,
synchronization, etc), so the actual per-connection connection time is
probably closer to O(n) than O(n^2).

Q: Did you check that pgbench or the OS does not have
O(n_active_connections) or O(n_active_threads) overhead per worker
during thread creation or connection establishment, e.g. by varying
the number of threads used to manage these N clients? I wouldn't be
surprised if there are inefficiencies in e.g. the threading- or
synchronization model that cause O(N) per-thread overhead, or O(N^2)
overall when you have one thread per connection.

Kind regards,

Matthias van de Meent
Neon (https://neon.tech)

#4Потапов Александр
a.potapov@postgrespro.ru
In reply to: Matthias van de Meent (#3)
Re: Init connection time grows quadratically

Hi Matthias,
 
I did additional experiments (changed a number of threads on pgbench side an on server side) but it did find not chanches.
 

Вторник, Май 27, 2025 14:36 MSK, Matthias van de Meent <boekewurm+postgres@gmail.com> писал(а):

 
On Tue, 27 May 2025 at 12:45, Потапов Александр
<a.potapov@postgrespro.ru> wrote:

Hello!

I ran some experiments with pgbench to measure the initialization time and found that the time increases quadratically with the number of clients. It was surprising to me and I would like to understand a reason of such behavior.

Some details on how it was done:

[...]

It turned out that the results correspond to a quadratic dependence like y ~ 0.0002x^2 where x is a number of clients and y is init time (ms).
Here there is a question: is it expected behavior or a bug? What do you think? I appreciate any comments and opinions.

Note that the value of "initial connection time" is based on the time
it takes from about the start of the pg_bench process until the moment
all N expected connections have been established, *not* the average
time it took pg_bench to connect to PostgreSQL. This does also not
exclude other known measurable delays (like spawning threads,
synchronization, etc), so the actual per-connection connection time is
probably closer to O(n) than O(n^2).

Q: Did you check that pgbench or the OS does not have
O(n_active_connections) or O(n_active_threads) overhead per worker
during thread creation or connection establishment, e.g. by varying
the number of threads used to manage these N clients? I wouldn't be
surprised if there are inefficiencies in e.g. the threading- or
synchronization model that cause O(N) per-thread overhead, or O(N^2)
overall when you have one thread per connection.

Kind regards,

Matthias van de Meent
Neon (https://neon.tech)

 

 

#5Потапов Александр
a.potapov@postgrespro.ru
In reply to: Потапов Александр (#4)
1 attachment(s)
Re: Init connection time grows quadratically

To be more precise I used constant number of threads (128 and 1024) to compare with previous results. The quadratic dependency exists everywhere, see new graph.

Q: Did you check that pgbench or the OS does not have
O(n_active_connections) or O(n_active_threads) overhead per worker
during thread creation or connection establishment, e.g. by varying
the number of threads used to manage these N clients? I wouldn't be
surprised if there are inefficiencies in e.g. the threading- or
synchronization model that cause O(N) per-thread overhead, or O(N^2)
overall when you have one thread per connection.

 

Attachments:

init_time_2caa85f4aae_const_threads_2.pngimage/pngDownload