Hi,
After update GLPI, when we create or read a ticket, loading of page is very, very long !
Other action in GLPI is normal.
I try to install GLPI in a virtual machine azure with th best performance but the result is same.
Thanks for your help.
GLPI 9.4.1.1 ( => /mnt/disk/plesk/XXXXX/httpdocs) Installation mode: TARBALL
Operating system: Linux vps 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64 PHP PHP 7.3.3 fpm-fcgi (Core, PDO, PDO_ODBC, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, bz2, calendar, cgi-fcgi, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, ionCube Loader, json, ldap, libxml, mbstring, mysqli, mysqlnd, odbc, openssl, pcre, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, posix, pspell, redis, session, soap, sockets, sodium, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="60" memory_limit="256M" post_max_size="8M" safe_mode="" session.save_handler="files"
upload_max_filesize="2M"
Software: nginx/1.14.2
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0
Server Software: (Debian)
Server Version: 10.0.38-MariaDB-0+deb8u1
Server SQL Mode:
Parameters: glpi@localhost:3306/glpi
Host info: Localhost via UNIX socket
mysqli extension is installed
ctype extension is installed
fileinfo extension is installed
json extension is installed mbstring
extension is installed
iconv extension is installed
zlib extension is installed
curl extension is installed gd
extension is installed simplexml
extension is installed xml
extension is installed ldap
extension is installed imap
extension is installed Zend OPcache
extension is installed xmlrpc
extension is installed exif extension is installed
APCu extension is not present
CAS extension is not present
Database version seems correct (10.0.38) - Perfect!
/mnt/disk/plesk/XXXXXX/httpdocs/files/_log : OK
/mnt/disk/plesk/XXXXXX/httpdocs/config : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files/_dumps : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files/_sessions : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files/_cron : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files/_graphs : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files/_lock : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files/_plugins : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files/_tmp : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files/_cache : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files/_rss : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files/_uploads : OK
/mnt/disk/plesk/XXXXXX/httpdocs/files/_pictures : OK
Web access to files directory is protected : OKhtmLawed version 1.2.4 in (/mnt/disk/plesk/XXXXXX/httpdocs/lib/htmlawed) phpmailer/phpmailer version 6.0.7 in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/phpmailer/phpmailer/src) simplepie/simplepie version 1.5.2 in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/simplepie/simplepie/library) tecnickcom/tcpdf version 6.2.26 in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/tecnickcom/tcpdf) michelf/php-markdown in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/michelf/php-markdown/Michelf) true/punycode in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/true/punycode/src) iamcal/lib_autolink in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/iamcal/lib_autolink) sabre/vobject in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/sabre/vobject/lib) zendframework/zend-cache in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/zendframework/zend-cache/src) zendframework/zend-i18n in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/zendframework/zend-i18n/src) zendframework/zend-serializer in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/zendframework/zend-serializer/src) monolog/monolog in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/monolog/monolog/src/Monolog) sebastian/diff in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/sebastian/diff/src) elvanto/litemoji in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/elvanto/litemoji/src) symfony/console in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/symfony/console) leafo/scssphp in (/mnt/disk/plesk/XXXXXX/httpdocs/vendor/leafo/scssphp/src)
Not active
Way of sending emails: SMTP+TLS ([email protected])
Name: 'XXXXXX' Active: Yes Server: '{outlook.office365.com:993/imap/ssl}' Login: 'XXXXXX' Password: Yes
fields Name: Champs suppl茅mentaires Version: 1.9.1 State: Enabled
formcreator Name: Form Creator Version: 2.8.0 State: Not activated
fusioninventory Name: FusionInventory Version: 9.4.0+1.0 State: Enabled
mod Name: GLPI Modifications Version: 1.2.4 State: Not installed
moreticket Name: More ticket Version: 1.5.0 State: Enabled
Cache d鈥橭Pcode de PHP
L'extension "Zend OPcache" est install茅e | 7.3.3
M茅moire | 20.91 Mio / 128 Mio | 16%
Taux de succ猫s | 5836 / 6062 | 96%
Red茅marrage pour cause de m茅moire satur茅e | 0Cache des donn茅es utilisateur
"filesystem" du cache syst猫me est utilis茅
I have the same issue here after upgrade from 9.3.3 to 9.4.1.1
My system:
{
"glpi": {
"uuid": "MRaizpbTXfhzZ2L5TTF3oGh69uCqutZNvF2NY6tR",
"version": "9.4.1.1",
"plugins": [
{
"key": "fusioninventory",
"version": "9.4.0+1.0"
}
],
"default_language": "pt_BR",
"install_mode": "TARBALL",
"usage": {
"avg_entities": "0-500",
"avg_computers": "0-500",
"avg_networkequipments": "0-500",
"avg_tickets": "10000-50000",
"avg_problems": "0-500",
"avg_changes": "0-500",
"avg_projects": "0-500",
"avg_users": "0-500",
"avg_groups": "0-500",
"ldap_enabled": true,
"mailcollector_enabled": false,
"notifications_modes": [],
"notifications": [
"mailing",
"ajax"
]
}
},
"system": {
"db": {
"engine": "MariaDB Server",
"version": "10.3.13-MariaDB-log",
"size": "3122.3",
"log_size": "",
"sql_mode": ""
},
"web_server": {
"engine": "Apache",
"version": "2.4.34"
},
"php": {
"version": "7.1.8",
"modules": [
"Core",
"date",
"libxml",
"openssl",
"pcre",
"zlib",
"filter",
"hash",
"Reflection",
"SPL",
"session",
"standard",
"apache2handler",
"bz2",
"calendar",
"ctype",
"curl",
"dom",
"mbstring",
"fileinfo",
"ftp",
"gd",
"gettext",
"iconv",
"intl",
"json",
"ldap",
"exif",
"mysqlnd",
"PDO",
"Phar",
"posix",
"shmop",
"SimpleXML",
"soap",
"sockets",
"sqlite3",
"sysvmsg",
"sysvsem",
"sysvshm",
"tokenizer",
"xml",
"xmlwriter",
"xsl",
"zip",
"mysqli",
"pdo_mysql",
"pdo_sqlite",
"wddx",
"xmlreader",
"xmlrpc",
"apcu",
"Zend OPcache"
],
"setup": {
"max_execution_time": "30",
"memory_limit": "256M",
"post_max_size": "8M",
"safe_mode": false,
"session": "files",
"upload_max_filesize": "5M"
}
},
"os": {
"family": "Linux",
"distribution": "Red Hat Enterprise Linux Server release 7.6 (Maipo)",
"version": "3.10.0-957.10.1.el7.x86_64"
}
}
}
There is news.
I did a test by changing the ticket display mode.
And when I use the "_Tab on the left_" mode, only the tab of the ticket is long at loading. The others are fast.
The problem is therefore focused on loading ticket information.

I think this is the generation of the array in inc/tickettemplate.class.php - function getAllowedFields.
https://github.com/glpi-project/glpi/blob/9.4/bugfixes/inc/tickettemplate.class.php#L144
If I make a return $allowed_fields[$withtypeandcategory] [$withitemtype]; before filling the table, the ticket display is immediate
this array is additionally regenerated with each call getMandatoryFields, getHiddenFields, getPredefinedFields (can be used as parameter ?)
I just checked the file
/ inc / tickettemplate.class.php
and I have on line 144 the value:
static function getAllowedFields ($ withtypeandcategory = 0, $ withitemtype = 0) {
Is this correct?
What should I change?
I think this is the generation of the array in inc/tickettemplate.class.php - function getAllowedFields.
[...]
If I make a return $allowed_fields[$withtypeandcategory] [$withitemtype]; before filling the table, the ticket display is immediate
Could you post an example of generated array somewhere? Until I miss something, this mainly loop on search options; so this can take times, yes, but not so much.
Also, could you make sure any plugin is in cause?
[2019-03-22 20:53:42] glpiphplog.WARNING: TicketTemplate::getAllowedFields() in C:\wamp\www\glpi\inc\tickettemplate.class.php line 250
Array
(
[1] => name
[21] => content
[12] => status
[10] => urgency
[11] => impact
[3] => priority
[9] => requesttypes_id
[83] => locations_id
[37] => slas_id_tto
[30] => slas_id_ttr
[190] => olas_id_tto
[191] => olas_id_ttr
[18] => time_to_resolve
[155] => time_to_own
[180] => internal_time_to_resolve
[185] => internal_time_to_own
[15] => date
[45] => actiontime
[52] => global_validation
[4] => _users_id_requester
[71] => _groups_id_requester
[5] => _users_id_assign
[8] => _groups_id_assign
[6] => _suppliers_id_assign
[66] => _users_id_observer
[65] => _groups_id_observer
[131] => itemtype
[13] => items_id
[-2] => _add_validation
[142] => _documents_id
[175] => _tasktemplates_id
)
without plugins


11 seconds
if i had
return $allowed_fields[$withtypeandcategory][$withitemtype];
after
static $allowed_fields = [];


4 seconds
Thank you. So I guess problem is how this array is used.
Could you post a Toolbox::backtrace() output to know where this method is called?
2019-03-23 09:45:14 [2@P399]
Backtrace :
inc\tickettemplate.class.php:249 Toolbox::backtrace()
inc\tickettemplatehiddenfield.class.php:149 TicketTemplate::getAllowedFields()
inc\tickettemplate.class.php:83 TicketTemplateHiddenField->getHiddenFields()
inc\ticket.class.php:4372 TicketTemplate->getFromDBWithDatas()
inc\ticket.class.php:4551 Ticket->getTicketTemplateToUse()
inc\commonglpi.class.php:475 Ticket->showForm()
ajax\common.tabs.php:92 CommonGLPI::displayStandardTab()
2019-03-23 09:45:14 [2@P399]
Backtrace :
inc\tickettemplate.class.php:249 Toolbox::backtrace()
inc\tickettemplatemandatoryfield.class.php:149 TicketTemplate::getAllowedFields()
inc\tickettemplate.class.php:93 TicketTemplateMandatoryField->getMandatoryFields()
inc\ticket.class.php:4372 TicketTemplate->getFromDBWithDatas()
inc\ticket.class.php:4551 Ticket->getTicketTemplateToUse()
inc\commonglpi.class.php:475 Ticket->showForm()
ajax\common.tabs.php:92 CommonGLPI::displayStandardTab()
2019-03-23 09:45:17 [2@P399]
Backtrace :
inc\tickettemplate.class.php:249 Toolbox::backtrace()
inc\tickettemplatepredefinedfield.class.php:170 TicketTemplate::getAllowedFields()
inc\tickettemplate.class.php:103 TicketTemplatePredefinedField->getPredefinedFields()
inc\ticket.class.php:4372 TicketTemplate->getFromDBWithDatas()
inc\ticket.class.php:4551 Ticket->getTicketTemplateToUse()
inc\commonglpi.class.php:475 Ticket->showForm()
ajax\common.tabs.php:92 CommonGLPI::displayStandardTab()
Thank you again. Well, that does not seems to explain what goes wrong :/ This needs more investigation
If you add at beginning of getFromDBWithDatas function the call of $allowed_fields = $this->getAllowedFields(); & use it into each getMandatoryFields, getHiddenFields, getPredefinedFields as parameter, the loading is much better (8s). Not the best result, but this load array one time & not three times.
2019-03-23 10:53:15 [2@P399]
Backtrace :
inc\tickettemplate.class.php:251 Toolbox::backtrace()
inc\tickettemplate.class.php:82 TicketTemplate::getAllowedFields()
inc\ticket.class.php:4342 TicketTemplate->getFromDBWithDatas()
inc\ticket.class.php:4551 Ticket->getTicketTemplateToUse()
inc\commonglpi.class.php:475 Ticket->showForm()
ajax\common.tabs.php:92 CommonGLPI::displayStandardTab()
If i compare with 9.3 (Toolbox::logwarning($allowed_fields);)
9.3
[2019-03-23 11:14:32] glpiphplog.WARNING: TicketTemplate::getAllowedFields() in C:\wamp\www\glpi93\inc\tickettemplate.class.php line 249
Array
(
[1] => Array
(
[0] => Array
(
[1] => name
...
)
[1] => Array
(
[1] => name
...
)
)
)
9.4
[2019-03-23 11:16:14] glpiphplog.WARNING: TicketTemplate::getAllowedFields() in C:\wamp\www\glpi\inc\tickettemplate.class.php line 249
Array
(
[0] => Array
(
[0] => Array
(
[1] => name
...
)
[1] => Array
(
[1] => name
...
)
)
[1] => Array
(
[0] => Array
(
[1] => name
...
)
)
)
There is more loop.
Hi tsmr, trasher,
Here are my performances when i open a ticket with no plugin

When i create new ticket with no plugin

Do you have a temporary solution to improve performance ?
I did not understand the changes previously proposed.
What can I do to help you to find the solution ?
I am in the situation where my manager is questioning the solution because it is far too slow.
And I can not go back.
Thank you in advance for your help.
Code is loading a lot of time same datas just to display fields...
Solution, load these datas once then reuse previous loaded...
Solution OK for version GLPI 9.4.1.1
File \inc\commondbtm.class.php
Function : public final function searchOptions()
ADD just after declaration :
/*DENIS*/ if(defined('DenisSearchOptionsCache')) return DenisSearchOptionsCache;
THEN at the end of funtion, just before return :
/*DENIS*/ define('DenisSearchOptionsCache',$options);
Do the same in file \inc\ticket.class.php
Function : function rawSearchOptions()
ADD just after declaration :
/*DENIS*/ if(defined('DenisRawSearchOptionsCache')) return DenisRawSearchOptionsCache;
THEN at the end of funtion, just before return :
/*DENIS*/ define('DenisRawSearchOptionsCache',$tab);
Solution proposed here is not global, while problem is global.
Please try with proposed fix: #5666 ans give feedbacks. Thank you.
Hello,
Thanks for your feedback.
How can I patch my version?
Hello @Jeff-Tall
get the patch here:https://github.com/glpi-project/glpi/pull/5666.patch
And apply it for glpi root directory:
patch -p1 < 5666.patch
Hello @orthagh
I do
wget https://github.com/glpi-project/glpi/pull/5666.patch in my glpi folder.
and
patch -p1 < 5666.patch
What i must write for File to patch:
I try/whith no result.
File to patch: /
File / is not a regular file -- refusing to patch
1 out of 1 hunk ignored -- saving rejects to file /.rej
can't find file to patch at input line 42
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/inc/commondbtm.class.php b/inc/commondbtm.class.php
|index 2ef65644e3..601ab372d6 100644
|--- a/inc/commondbtm.class.php
|+++ b/inc/commondbtm.class.php
--------------------------
File to patch:
Wait tomorrow morning, the updated 9.4/bugfixes nightly archive with the fix will be aivailable at:
https://forge.glpi-project.org/tarballs/
I pray that my problem of slowness will improve.
You do a great job anyway.
I'll give you a return tomorrow morning.
Thank you @tsmr @trasher @orthagh
I have applied this patch and the performance is fine again.
Thank you!
Thank you all for your reviews.
Regards
Hi,
Applying the 5666 patch solved the performance issue.
Thanks
Alelouya !
The performances are back ! Thanks you !
On the other hand the loading of the list of the applicants remains long...
@orthagh
Hello everyone, I really do not have much experience in this project and I am not a programmer, I need help applying the patch 5666, but I do not know how to do it in the Windows environment
Can someone please help me?
Use latest nightly or wait for 9.4.2 release.
Use latest nightly or wait for 9.4.2 release.
@trasher Thank you very much for the response, I do not know how much delay version 9.4.2, and I have some hurry to solve the performance issues of the current version, but I do not know what to do with the file that is downloaded. I have windows server and I would greatly appreciate if you could guide me with a step by step because I do not have a lot of experience manipulating these topics, and in comments from previous users I have seen that this solution has worked
I would also like to learn the procedure
How do I know which commit correspond to the package glpi-9.4.1.1.tgz ?
How can I apply a patch on mydeployed glpi if i dont know nether my commit nor that of the patch ?
Just update to 9.4.2