Hello,
I’m developing a sinatra application. When deployed on a FreeBSD server
the OAuth calls slow down incredibly. I don’t know why this happens and
I’m not even sure where or what to start looking for.
The program does a series of OAuth2 calls. I wrote a script to test an
OAuth2 call and logged the results:
–
#!/usr/bin/env ruby
require ‘./pritory’
require ‘benchmark’
x = Skroutz::Query.new
Benchmark.bm do |bm|
bm.report do
# Fetch price and print!
x.skroutz_check ‘3517212’ # => returns price String e.g. ‘72.12’
end
end
OSX
ruby --version && uname -a
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin13.0.0]
Darwin gauss.local 13.3.0 Darwin Kernel Version 13.3.0: Tue Jun 3
21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
macosx-dev> ruby test.rb
user system total real
0.110000 0.020000 0.130000 ( 4.564007)
FreeBSD
ruby --version && uname -a
ruby 2.1.2p95 (2014-05-08 revision 45877) [amd64-freebsd10]
FreeBSD myhostname.net 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu
Jan 16 22:34:59 UTC 2014
[email protected]:/usr/obj/usr/src/sys/GENERIC amd64
freebsd-10-prod> ruby test.rb
user system total real
0.117188 0.007812 0.125000 ( 71.876525)
The module code can be found here:
Any ideas where/what to start looking for?
The FreeBSD server runs on a VM as a VPS. There are other applications
without problems (sinatra apps + ruby scripts).
Panagiotis (atmosx) Atmatzidis
email: [email protected]
URL: http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5
“As you set out for Ithaca, hope the voyage is a long one, full of
adventure, full of discovery […]” - C. P. Cavafy