Bug #4249

0.5s delay on CLI commands

Added by Rolandas Naujikas over 5 years ago. Updated over 5 years ago.

Status:PendingStart date:12/15/2015
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:CLI
Target version:-
Resolution: Pull request:
Affected Versions:OpenNebula 4.14

Description

Every CLI command takes at least 0.5s to execute even when no data are in MySQL DB.
Time increases if more data to query. In older version 4.12 it takes almost zero time (~0.1s).

Debain 8.2 + opennebula 4.14.2 (from one-4.14) compiled from source.
Server is 4 cores and 12GB RAM.

onehost.txt Magnifier - ruby-prof $(which onehost) list output (56.8 KB) Rolandas Naujikas, 12/19/2015 07:44 AM

History

#1 Updated by Ruben S. Montero over 5 years ago

Hi

This is likely becasue of the ruby gems/versions. Can you send the list of gems installed and ruby version that you are using?

#2 Updated by Rolandas Naujikas over 5 years ago

ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu] - from Debian 8.2

gem list - part from Debian 8, others from ruby repository

bigdecimal (1.2.4)
daemons (1.1.9)
eventmachine (1.0.3)
hiera (1.3.4)
io-console (0.4.2)
json (1.8.1)
minitest (4.7.5)
mysql (2.9.1)
net-ldap (0.8.0)
nokogiri (1.6.3.1)
ox (2.1.1)
parse-cron (0.1.4)
pg (0.17.1)
polyglot (0.3.5)
psych (2.0.5)
rack (1.5.2)
rack-protection (1.5.2)
rake (10.3.2, 10.1.0)
rdoc (4.1.0)
ruby-shadow (2.3.4)
ruby-termios (1.0.0)
safe_yaml (1.0.3)
sequel (4.15.0)
sequel_pg (1.6.10)
sinatra (1.4.5)
test-unit (2.1.5.0)
thin (1.3.1)
tilt (1.4.1)
treetop (1.6.3)
uuidtools (2.1.4)

Last moment I added ruby-ox, but it didn't improve.

#3 Updated by Javi Fontan over 5 years ago

Profiling in a VM that should be slower than you machine I get around 0.3 seconds for a onehost list without hosts. Most of the time is requiring libraries:

 %self      total      self      wait     child     calls  name
  2.39      0.268     0.007     0.000     0.261      345  *Kernel#gem_original_require

Can you send me a profile output of the same command? To do this:

apt-get install ruby-devel build-essential
gem install ruby-prof
ruby-prof $(which onehost) list

#4 Updated by Rolandas Naujikas over 5 years ago

Attaching ruby-prof $(which onehost) list output.

Also available in: Atom PDF