So, if total memory allocation is NOT too big (it does not depend on enabled status), it seems we can start with all/most dynamic instruments disabled by default, and then enable them when needed. This will give faster startup at a cost of some delays for enabling instruments later.
Surely, memory allocated depends on instrumentation used. If we disable all instruments startup is instant:
[openxs@chief p5.6]$ bin/mysqld_safe --no-defaults --table_ definition_ cache=50000 --performance- schema- instrument= '%=OFF' &
[1] 2849
... www.percona. com) 5.6.27-75.0 started; log sequence number 288279594 dbs/p5. 6/bin/mysqld: ready for connections.
2015-11-20 12:30:55 2945 [Note] InnoDB: Highest supported file format is Barracuda.
2015-11-20 12:30:55 2945 [Note] InnoDB: 128 rollback segment(s) are active.
2015-11-20 12:30:55 2945 [Note] InnoDB: Waiting for purge to start
2015-11-20 12:30:55 2945 [Note] InnoDB: Percona XtraDB (http://
2015-11-20 12:30:55 2945 [Note] Server hostname (bind-address): '*'; port: 3306
2015-11-20 12:30:55 2945 [Note] IPv6 is available.
2015-11-20 12:30:55 2945 [Note] - '::' resolves to '::';
2015-11-20 12:30:55 2945 [Note] Server socket created on IP: '::'.
2015-11-20 12:30:55 2945 [Note] Event Scheduler: Loaded 0 events
2015-11-20 12:30:55 2945 [Note] /home/openxs/
Version: '5.6.27-75.0' socket: '/tmp/mysql.sock' port: 3306 MySQL Community Server (GPL)
Even though memory use is reported the same:
| performance_schema | performance_ schema. memory | 1794090344 | ------- ------- +------ ------- ------- ------- ------- ------- ------- ------- ------- +------ ------+
+------
167 rows in set (0.00 sec)
Enabling instruments after startup seems to work fastert, and may work well for those that can be re-enabled after startup:
mysql> update performance_ schema. setup_instrumen ts set enabled = 'YES', timed='YES';
Query OK, 582 rows affected (3.05 sec)
Rows matched: 582 Changed: 582 Warnings: 0
So, if total memory allocation is NOT too big (it does not depend on enabled status), it seems we can start with all/most dynamic instruments disabled by default, and then enable them when needed. This will give faster startup at a cost of some delays for enabling instruments later.