Bad performance / slow response when many concurrent sorts are executed
-----------------------------------------------------------------------

                 Key: CORE-3989
                 URL: http://tracker.firebirdsql.org/browse/CORE-3989
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 2.5.2, 2.1.5, 2.0.7, 2.5.1, 2.1.4, 2.5.0, 2.0.6, 3.0 
Initial, 2.1.3, 2.1.2, 2.0.5, 2.1.1, 2.1.0
         Environment: Reported and debugged on Linux, but generally 
platform-independent
            Reporter: Dmitry Yemanov


The issue manifests itself as slow server response under high load when many 
concurrent connections are performing external sorts (i.e. PLAN SORT). 
Backtrace shows that many threads are spending unexpectedly long time in system 
calls mmap/munmap. Besides being a partucular connection's problem, it's also 
blocking the AST delivery thus affecting other connections as well. In Classic 
/ SuperClassic it may result to temporary (up to multiple seconds) server 
freezes.

The problem is that the every sort (regardless of its size) needs 128KB of 
memory for the first level buffer and such big allocations are redirected to 
the operating system. With a high number of relatively small (read: cheap) 
sorts the engine tends to spend more time mapping/unmapping the memory than 
sorting the records.

The proposed solution is to cache a few recently used sort buffers and reuse 
them in subsequent sorts rather than dealing with the system memory manager. 
The field tesing has proved that being an effective measure.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to