-
Notifications
You must be signed in to change notification settings - Fork 29
MySQL support #7
base: master
Are you sure you want to change the base?
Conversation
I wrote a small app to benchmark sequel gem versus the sinatra/activerecord gem. require 'sinatra' #these also work but all have the same problem of the sinatra app locking up when running benchmark with concurrency : #as recommended by the sequel wiki use a constant: class User < Sequel::Model get '/' do get '/getAuthToken' do post '/getAuthToken' do get '/users' do #json request sequel Here is my config.ru: root_dir = File.dirname(FILE) disable :run run Sinatra::Application When I run this with Passenger/apache2. All works Benchmarking viu.sitweb.eu (be patient) So it just hangs after 991 requests. Now when I changed the app to use sinatra/activerecord I get following great results: Benchmarking viu.sitweb.eu (be patient) Server Software: Apache/2.2.16 Document Path: /user/100 Concurrency Level: 10 So anyone can solve my issue. Basically if I change in above source code to this: class User < ActiveRecord::Base Everything is working great. And what boggles me is that the sinatra/activerecord is supposed to be based on the sequel gem so why is it performing so much better??? |
sinatra-activerecord is not based on sinatra-sequel. the former uses activerecord, and the latter uses sequel. If you need help with sinatra-activerecord, you're better off asking in that project than here. |
I need help with Sinatra sequel since it hangs with all apache benchmarks on a mysql db. Gave the activerecord as extra |
Gave the complete test Sinatra app that uses sequel above. Maybe someone can test to see if it works on their setup. When I run ruby app.rb it runs fine but with passenger it freezes when testing it with ab -n 1000 -c 10 'http://localhost....' |
I love the much quicker startup times of sequel vs activerecord in a new project I would go for postgress but I'm fixed on a legacy mysql db at work that is used by many other daemons already... |
Sorry mister Walle, but I believe you're asking in the wrong place. First of all, the slowdown would probably be a Sequel issue, you may want to open an issue there (https://github.com/jeremyevans/sequel) about your lockup issues. If you're having trouble with Passenger, look at their site's support area and see if you can get help there. Also, both Sequel and ActiveRecord support both MySQL and Postgres. |
Thanks for the quick reply. Indeed it's probably sequel gem issue with mysql2. I've ruled out the passenger and Sinatra above. So my best bet is to ask Jeremy about it. Keep up the great work. Kind regards,w. |
I'm getting this error using MySQL 14.14, ruby mysql gem 2.8.1, sinatra-sequel 0.9.0:
The culprit seems to be:
Which should instead be:
...I tried adding
index :name
but I can't figure out the correct switches to give it a size. (index "name(512)".lit
still doesn't work.)Furthermore,
:encoding => 'utf-8'
doesn't work in MySQL, it needs:encoding => 'utf8'
instead.