Comments (4)
FYI here is a normal stackprof
output:
$ 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>
from makara.
Can you try pulling new_relic and see what the traces looks like?
from makara.
Also, thank you. This is helpful. I'd love to track this down.
from makara.
Thanks, pulling newrelic
and the performance now seems fine:
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
output:
$ 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
from makara.
Related Issues (20)
- In development: makara hides the query logs references HOT 1
- ActiveRecord::Base.connection.select raises TypeError with makara-0.5.1 HOT 1
- No CHANGELOG entry for 0.5.1 HOT 5
- rake db:migrate not running HOT 1
- How to send a read query to master explicitly?
- How to send a read query to master explicitly? HOT 1
- Override master db selection method not working HOT 2
- Deprecation warning for Ruby 3 HOT 3
- Proxied control methods generated do not respect arity HOT 7
- It should be `:replica` instead of `:primary` HOT 2
- Deprecation warning for Ruby3 HOT 2
- Registering Types not working?
- Choosing Primary instead of Replica when using 'with' (because of newlines)
- When blacklist is disabled, gracefully error handling causes infinite retries.
- Deprecation warning with Rails 7.1 HOT 1
- Makara latest + ruby 3: `NoMethodError: undefined method 'provide' for nil:NilClass` HOT 4
- Determine programmatically what replica a request is using
- Seems broken on Rails 7.1 HOT 1
- Is this gem still being maintained? HOT 1
- Rails 7.2: AdapterNotFound: 'postgresql_makara'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from makara.