-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
performance issue #71
Comments
FYI here is a normal $ stackprof tmp/stackprof-cpu-13485-1422007173.dump --limit 10
==================================
Mode: cpu(1000)
Samples: 28 (17.65% miss rate)
GC: 2 (7.14%)
==================================
TOTAL (pct) SAMPLES (pct) FRAME
3 (10.7%) 2 (7.1%) ActiveRecord::LazyAttributeHash#[]
4 (14.3%) 2 (7.1%) block in ActiveSupport::Dependencies::Loadable#require
2 (7.1%) 2 (7.1%) ThreadSafe::NonConcurrentCacheBackend#[]
1 (3.6%) 1 (3.6%) ActiveRecord::LazyAttributeHash#assign_default_value
1 (3.6%) 1 (3.6%) ActiveSupport::HashWithIndifferentAccess#update
1 (3.6%) 1 (3.6%) ActiveModel::AttributeMethods::ClassMethods#define_proxy_call
1 (3.6%) 1 (3.6%) block in ActiveRecord::Result#hash_rows
1 (3.6%) 1 (3.6%) ActiveRecord::Relation::Merger#filter_binds
1 (3.6%) 1 (3.6%) <module:Associations>
2 (7.1%) 1 (3.6%) <module:Associations> |
Can you try pulling new_relic and see what the traces looks like? |
Also, thank you. This is helpful. I'd love to track this down. |
Thanks, pulling without makara: $ http_load -parallel 10 -seconds 10 urls.txt
1287 fetches, 10 max parallel, 9.26704e+06 bytes, in 10 seconds
7200.5 mean bytes/connection
128.7 fetches/sec, 926704 bytes/sec
msecs/connect: 0.0838073 mean, 0.31 max, 0.032 min
msecs/first-response: 77.298 mean, 1101 max, 22.64 min
HTTP response codes:
code 200 -- 1287 with makara: $ http_load -parallel 10 -seconds 10 urls.txt
1295 fetches, 10 max parallel, 9.5496e+06 bytes, in 10 seconds
7374.21 mean bytes/connection
129.5 fetches/sec, 954959 bytes/sec
msecs/connect: 0.0919042 mean, 0.638 max, 0.031 min
msecs/first-response: 76.8999 mean, 1177.08 max, 20.856 min
HTTP response codes:
code 200 -- 1295 full $ stackprof tmp/stackprof-cpu-10023-1422039178.dump
==================================
Mode: cpu(1000)
Samples: 26 (0.00% miss rate)
GC: 0 (0.00%)
==================================
TOTAL (pct) SAMPLES (pct) FRAME
2 (7.7%) 2 (7.7%) block in ActiveSupport::Dependencies::Loadable#require
1 (3.8%) 1 (3.8%) <module:Associations>
1 (3.8%) 1 (3.8%) singleton class
2 (7.7%) 1 (3.8%) singleton class
1 (3.8%) 1 (3.8%) block (2 levels) in Net::HTTPResponse::Inflater#inflate_adapter
1 (3.8%) 1 (3.8%) block in Net::HTTP#connect
1 (3.8%) 1 (3.8%) Net::HTTP#begin_transport
1 (3.8%) 1 (3.8%) ActiveSupport::HashWithIndifferentAccess#default
1 (3.8%) 1 (3.8%) #<Module:0x007ff0c263eee8>.set_name_cache
1 (3.8%) 1 (3.8%) ActiveModel::AttributeMethods::ClassMethods#define_proxy_call
1 (3.8%) 1 (3.8%) ActiveRecord::Scoping::ScopeRegistry#raise_invalid_scope_type!
1 (3.8%) 1 (3.8%) <module:Associations>
1 (3.8%) 1 (3.8%) ActiveSupport::JSON::Encoding::JSONGemEncoder::EscapedString#to_json
2 (7.7%) 1 (3.8%) ActiveRecord::Reflection::AssociationReflection#association_class
1 (3.8%) 1 (3.8%) ActiveModel::AttributeMethods::ClassMethods#define_proxy_call
1 (3.8%) 1 (3.8%) block in ActiveRecord::AttributeMethods::AttributeMethodCache#[]
1 (3.8%) 1 (3.8%) block in ActiveRecord::DynamicMatchers::Method.match
1 (3.8%) 1 (3.8%) block in ActiveRecord::AttributeMethods::AttributeMethodCache#[]
1 (3.8%) 1 (3.8%) <module:ActiveRecord>
1 (3.8%) 1 (3.8%) block in Arel::Visitors::Visitor.dispatch_cache
1 (3.8%) 1 (3.8%) ActiveRecord::QueryMethods#where!
1 (3.8%) 1 (3.8%) ThreadSafe::Cache#initialize
2 (7.7%) 1 (3.8%) ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter#configure_connection
1 (3.8%) 1 (3.8%) Set#include?
4 (15.4%) 1 (3.8%) Makara::Proxy#initialize
1 (3.8%) 0 (0.0%) Net::HTTP#do_start
52 (200.0%) 0 (0.0%) Grape::Middleware::Base#call
26 (100.0%) 0 (0.0%) #<Class:0x007ff0c3dd9008>#call
26 (100.0%) 0 (0.0%) #<Class:0x007ff0c3dd9620>#call
26 (100.0%) 0 (0.0%) #<Class:0x007ff0c3dd9620>#call |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
there seems to be pretty heavy performance issue (~3x difference)
without makara:
$ http_load -parallel 30 -seconds 30 urls.txt 5238 fetches, 30 max parallel, 2.55437e+07 bytes, in 30 seconds 4876.62 mean bytes/connection 174.6 fetches/sec, 851458 bytes/sec msecs/connect: 0.0776838 mean, 3.995 max, 0.03 min msecs/first-response: 170.548 mean, 3399.14 max, 28.019 min HTTP response codes: code 200 -- 5238
with makara:
$ http_load -parallel 30 -seconds 30 urls.txt 1387 fetches, 30 max parallel, 6.79761e+06 bytes, in 30 seconds 4900.95 mean bytes/connection 46.2333 fetches/sec, 226587 bytes/sec msecs/connect: 0.100772 mean, 4.028 max, 0.034 min msecs/first-response: 641.824 mean, 5868.17 max, 119.309 min HTTP response codes: code 200 -- 1387
my set of relevant gems are:
with
stackprof
I found that a lot of the time/CPU spent onDelegator#method_missing
Any ideas?
The text was updated successfully, but these errors were encountered: