[MXS-1412] Performance issue with MaxRows filter Created: 2017-09-13  Updated: 2020-08-25  Resolved: 2017-09-14

Status: Closed
Project: MariaDB MaxScale
Component/s: maxrows
Affects Version/s: 2.1.7
Fix Version/s: 2.1.8

Type: Bug Priority: Critical
Reporter: Valerii Kravchuk Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

There is a performance issue with the MaxRows filter. When simple SELECT * FROM table (where there are millions of rows) is executed to see if the filter would trigger correctly and provide a different error in the log, 1 of 4 cpu cores on the server hit 100% and stayed there. 100% on a core for a single query seems like a lot. When the same query is executed without the MaxRows filter enabled, cpu usage is negligible.

Furthermore, while the core was at 100% like this, queries hitting the backend were taking several seconds to complete, stuck in a state of 'writing to net' and the user was labeled as 'unauthenticated user'. These same queries run in microseconds any other time.

As this happened on a server with 4 cores and threads=4 in the configuration file, it is expected to have all other queries routed mostly to the 3 idle cores. Either MaxScale was not routing them to the 3 idle cores, or there is a bottleneck somewhere else.

Relevant part of configuration file is:

[maxscale]
threads=4
...
 
[Galera Monitor]
type=monitor
module=galeramon
servers=N1, N2, N3
...
 
[Splitter Service]
type=service
router=readwritesplit
servers=N1, N2, N3
...
max_slave_connections=100%
connection_timeout=5400
disable_sescmd_history=true
max_sescmd_history=5
strict_multi_stmt=false
filters=Hint | MaxRows
 
[Hint]
type=filter
module=hintfilter
 
[MaxRows]
type=filter
module=maxrows
max_resultset_rows=300000
max_resultset_size=1T
max_resultset_return=error
...

This may be related/similar to https://jira.mariadb.org/browse/MXS-1212



 Comments   
Comment by markus makela [ 2017-09-14 ]

The packet calculation iterated over all captured packets instead of looking at only the new packets. This caused excessive execution times which are now fixed.

Generated at Thu Feb 08 04:06:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.