Re: Block On File Upload

2011-01-15 Thread John Maxwell
So the dyno then reroutes requests back to Nginx? really?

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Block On File Upload

2011-01-15 Thread Jimmy Thrasher
I think it's more precise to say that a dyno is a thin+rack combo, so the dyno 
*is* the web server receiving the request.

Jimmy

On Jan 15, 2011, at 2:54 PM, John Maxwell  wrote:

> So an upload to your app on heroku blocks the whole dyno whilst it is 
> uploading? Surely that isn't right - as the dyno shouldn't even be aware of 
> the post request until the web server itself has received the whole file? In 
> that case its just blocked whilst the app processes it?
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Heroku" group.
> To post to this group, send email to heroku@googlegroups.com.
> To unsubscribe from this group, send email to 
> heroku+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/heroku?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: heroku db:push doesnt work

2011-01-15 Thread ChrisWolf
I just ran "dtrace" on "ruby dbcheck.rb"  (sqlite test case I
mentioned earlier)
and I see:

  0  18561   open:entry ruby /Library/Ruby/Site/
1.8/universal-darwin10.0/sqlite3/sqlite3_native.bundle

Which is the sqlite3 bundle that comes "with" Ruby, rather then the
bundle that
comes with sqlite3-ruby gem.  Doing "nm" on the native library bundle
in  /Library/Ruby/Site
shows all the expected exported symbols.

So there appears to be two versions of sqlite3.  Confirmed:

$ gem list -d sqlite3

Installed at (1.3.2): /Library/Ruby/Gems/1.8
 (1.2.4): /System/Library/Frameworks/Ruby.framework/
Versions/1.8/usr/lib/ruby/gems/1.8

Now trying to uninstall the gem version, as Omar Latief suggests
which I hesitated to do before because it said "taps" depends on it:

# gem uninstall sqlite3-ruby
You have requested to uninstall the gem:
sqlite3-ruby-1.3.2
taps-0.3.14 depends on [sqlite3-ruby (~> 1.2)]
Continue with Uninstall? [Yn]  Y
Successfully uninstalled sqlite3-ruby-1.3.2

After finishing that, I can run "taps" and not get any errors.
However, when I run "heroku push:db", I see:

Sending data
0 tables, 0 records
Resetting sequences

In other words, no error messages, but it didn't work either,
because my app definitely has data, runs locally and uses sqlite3.


0 tables, 0 records
Resetting sequences





On Jan 15, 6:06 pm, ChrisWolf  wrote:
> Ok, I updated heroku and the problem is still there.  I really don't
> think it's a Heroku issue because
> I can reproduce the problem simply by invoking the "taps" executable,
> even without
> any command line arguments:
>
> $ taps
> /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3/
> sqlite3_native.bundle:
> dlsym(0x1014150c0, Init_sqlite3_native): symbol not found
> - /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3/
> sqlite3_native.bundle (LoadError)
>         from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
> `require'
>         from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3.rb:6
>         from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
> `gem_original_require'
>         [...]
>
> That native library looks fishy because "nm" reports only one defined
> symbol and one
> undefined (external) symbol:
>
> nm /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3/
> sqlite3_native.bundle
>  t __mh_bundle_header
>                  U dyld_stub_binder
>
> On Jan 11, 9:56 am, Asif  wrote:
>
> > Update your heroku gem (gem update heroku), and try again. It should
> > work now.
> > There was a bug at their end, but they have fixed it now.
>
> > --Asif
>
> > On Jan 10, 7:14 am, ChrisWolf  wrote:
>
> > > I am having the same issue.   The exact error I get is:
>
> > > $ heroku db:push
> > > Taps 0.3 Load Error: dlsym(0x101df8ef0, Init_sqlite3_native): symbol
> > > not found - /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3/
> > > sqlite3_native.bundle
> > > You may need to install or update the taps gem to use db commands.
>
> > > This is on MacOSX 10.6 ("Snow Leopard"), Ruby-1.8.7, and taps is
> > > definitely installed:
> > > gem list -d taps
> > > *** LOCAL GEMS ***
>
> > > taps (0.3.14)
>
> > > ...and if I run this test script:
>
> > > require 'rubygems'
> > > require 'sqlite3'
> > > tempname = "test.sqlite#{3+rand}"
> > > db = SQLite3::Database.new(tempname)
> > > puts db.execute('select sqlite_version()')
> > > db.close
> > > File.unlink(tempname)
>
> > > It reports the SQLite version correctly, so I assume the sqlite3-ruby
> > > gem is also properly installed.
>
> > > At this point, I'm totally stuck.  Or maybe pushing from Snow Leopard
> > > isn't supported?, but I doubt it.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: heroku db:push doesnt work

2011-01-15 Thread ChrisWolf
I can't find my second post from tonight, but I fixed the "taps" issue
by removing
sqlite3-ruby gem, per Omar Latief's suggestion - even though it
reports that "taps" depends on it.

I then ran "heroku push:db"  and it reported that it pushed zero
tables.  I then discovered
that of the two databases, "db/development.sqlite3.db" and "db/
production.sqlite3.db",
the development one was blank, so I did:

"heroku db:push sqlite://db/production.sqlite3.db"

This time it shows a number of tables and data being pushed, however,
before it finished, it croaked with this stack trace:
Sending schema
[...]
Sending data
9 tables, 58 records
/Library/Ruby/Gems/1.8/gems/json-1.4.6/lib/json/pure/generator.rb:
283:in `to_json': wrong argument type JSON::Pure::Generator::State
(expected Data) (TypeError)
from /Library/Ruby/Gems/1.8/gems/json-1.4.6/lib/json/pure/
generator.rb:283:in `json_transform'
[...]

But then I upgraded "taps" from 0.3.14 to the latest version (0.3.15)
and repeated the db:push
command - and lo and behold - it worked!  Problem solved!


-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Flushing memcache with Dalli

2011-01-15 Thread John Maxwell
Log into the console "heroku console" then just issue "Rails.cache.clear" 
and it'll all be gone.

John

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: heroku db:push doesnt work

2011-01-15 Thread ChrisWolf
Ok, I updated heroku and the problem is still there.  I really don't
think it's a Heroku issue because
I can reproduce the problem simply by invoking the "taps" executable,
even without
any command line arguments:

$ taps
/Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3/
sqlite3_native.bundle:
dlsym(0x1014150c0, Init_sqlite3_native): symbol not found
- /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3/
sqlite3_native.bundle (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`require'
from /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3.rb:6
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
[...]

That native library looks fishy because "nm" reports only one defined
symbol and one
undefined (external) symbol:

nm /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3/
sqlite3_native.bundle
 t __mh_bundle_header
 U dyld_stub_binder





On Jan 11, 9:56 am, Asif  wrote:
> Update your heroku gem (gem update heroku), and try again. It should
> work now.
> There was a bug at their end, but they have fixed it now.
>
> --Asif
>
> On Jan 10, 7:14 am, ChrisWolf  wrote:
>
> > I am having the same issue.   The exact error I get is:
>
> > $ heroku db:push
> > Taps 0.3 Load Error: dlsym(0x101df8ef0, Init_sqlite3_native): symbol
> > not found - /Library/Ruby/Gems/1.8/gems/sqlite3-ruby-1.3.2/lib/sqlite3/
> > sqlite3_native.bundle
> > You may need to install or update the taps gem to use db commands.
>
> > This is on MacOSX 10.6 ("Snow Leopard"), Ruby-1.8.7, and taps is
> > definitely installed:
> > gem list -d taps
> > *** LOCAL GEMS ***
>
> > taps (0.3.14)
>
> > ...and if I run this test script:
>
> > require 'rubygems'
> > require 'sqlite3'
> > tempname = "test.sqlite#{3+rand}"
> > db = SQLite3::Database.new(tempname)
> > puts db.execute('select sqlite_version()')
> > db.close
> > File.unlink(tempname)
>
> > It reports the SQLite version correctly, so I assume the sqlite3-ruby
> > gem is also properly installed.
>
> > At this point, I'm totally stuck.  Or maybe pushing from Snow Leopard
> > isn't supported?, but I doubt it.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Flushing memcache with Dalli

2011-01-15 Thread David Hall
We are using Dalli and the Memcache add-on and would like to flush our cache
to observe how our application behaves while the cache fills up.
Have tried this from the console:

>> t_dall.stats
=> {"mc3.ec2.northscale.net:11211"=>{"bytes"=>"88686484", "cas_misses"=>"0",
"delete_hits"=>"0", "get_hits"=>"406549", "rusage_system"=>"23116.67",
"pid"=>"7601", "cas_hits"=>"0", "incr_misses"=>"0",
"connection_structures"=>"1896", "evictions"=>"12901", "threads"=>"4",
"limit_maxbytes"=>"67108864", "incr_hits"=>"0", "cmd_flush"=>"9",
"decr_misses"=>"0", "pointer_size"=>"64", "daemon_connections"=>"10",
"time"=>"129478", "conn_yields"=>"0", "engine_maxbytes"=>"104857600",
"version"=>"1.4.4_188_g0117a2c", "total_items"=>"146544",
"bytes_written"=>"6622429660", "rejected_conns"=>"0", "decr_hits"=>"0",
"delete_misses"=>"0", "cmd_get"=>"479525", "total_connections"=>"13088175",
"curr_connections"=>"920", "uptime"=>"2955153", "auth_cmds"=>"1479",
"cmd_set"=>"146544", "rusage_user"=>"4756.090448", "curr_items"=>"15466",
"bytes_read"=>"1856824151", "cas_badval"=>"0", "get_misses"=>"72976"}}
>> t_dall.flush
=> [true]
>> t_dall.stats
=> {"mc3.ec2.northscale.net:11211"=>{"bytes"=>"88685654", "cas_misses"=>"0",
"delete_hits"=>"0", "get_hits"=>"406549", "rusage_system"=>"23117.65",
"pid"=>"7601", "cas_hits"=>"0", "incr_misses"=>"0",
"connection_structures"=>"1896", "evictions"=>"12902", "threads"=>"4",
"limit_maxbytes"=>"67108864", "incr_hits"=>"0", "cmd_flush"=>"11",
"decr_misses"=>"0", "pointer_size"=>"64", "daemon_connections"=>"10",
"time"=>"1295000178", "conn_yields"=>"0", "engine_maxbytes"=>"104857600",
"version"=>"1.4.4_188_g0117a2c", "total_items"=>"146562",
"bytes_written"=>"6622499298", "rejected_conns"=>"0", "decr_hits"=>"0",
"delete_misses"=>"0", "cmd_get"=>"479554", "total_connections"=>"13089214",
"curr_connections"=>"918", "uptime"=>"2955353", "auth_cmds"=>"1479",
"cmd_set"=>"146562", "rusage_user"=>"4757.580448", "curr_items"=>"15466",
"bytes_read"=>"1857585675", "cas_badval"=>"0", "get_misses"=>"73005"}}

So the flush method since ineffective. How should we do this?

-- 
David Hall, M. Sc.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Auto-scaling

2011-01-15 Thread John Maxwell
The Heroku gem itself can do this for you - if you put in a before or 
after_filter a quick check on HTTP_X_HEROKU_QUEUE_DEPTH or 
HTTP_X_HEROKU_QUEUE_WAIT_TIME 
depending on your criteria, then use the gem to add or remove a dyno as 
suits you.  Look at 
http://blog.darkhax.com/2010/07/30/auto-scale-your-resque-workers-on-heroku for 
inspiration on how to do it.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Auto-scaling

2011-01-15 Thread Neil
Are there any plans for some sort of option that we can tick that will let 
our applications scale to handle the load that we might get in spurts?

Reason I ask is that we've just had some TV advertising on one of our 
applications and gone from 40rpm to 3,500rpm in a matter of seconds.  It 
would be nice if there was a way that Heroku could spin up dynos when queues 
get to a certain length.

(and yes, I'm aware of all the stuff out there at the minute, I'm just 
interested in the 'native' stuff)

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Block On File Upload

2011-01-15 Thread John Maxwell
So an upload to your app on heroku blocks the whole dyno whilst it is 
uploading? Surely that isn't right - as the dyno shouldn't even be aware of 
the post request until the web server itself has received the whole file? In 
that case its just blocked whilst the app processes it?

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Memcached or Redis-to-Go

2011-01-15 Thread Peter van Hardenberg
Both are hosted on EC2 and have similar latency characteristics as a result.

P
On Jan 15, 2011 6:58 AM, "John Maxwell"  wrote:
> Hi,
>
> I was wondering how the network response differs between using Memcached
or
> Redis on Heroku. I'm happy using either for caching my app, but I was
> wondering which of the services has a better link into Heroku and thus is
> likely to offer better performance? (I'm not interested in a discussion
> about the merits of one over the other, just their performance within the
> Heroku platform!)
>
> Many thanks,
>
> John
>
> --
> You received this message because you are subscribed to the Google Groups
"Heroku" group.
> To post to this group, send email to heroku@googlegroups.com.
> To unsubscribe from this group, send email to
heroku+unsubscr...@googlegroups.com .
> For more options, visit this group at
http://groups.google.com/group/heroku?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Memcached or Redis-to-Go

2011-01-15 Thread Brandon Casci
 I move certain some data in and out out Heroku for processing with Redis-TG.  
I've been really impressed with the performance.

On Jan 15, 2011, at 9:58 AM, John Maxwell  wrote:

> Hi,
> 
> I was wondering how the network response differs between using Memcached or 
> Redis on Heroku. I'm happy using either for caching my app, but I was 
> wondering which of the services has a better link into Heroku and thus is 
> likely to offer better performance? (I'm not interested in a discussion about 
> the merits of one over the other, just their performance within the Heroku 
> platform!)
> 
> Many thanks,
> 
> John
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Heroku" group.
> To post to this group, send email to heroku@googlegroups.com.
> To unsubscribe from this group, send email to 
> heroku+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/heroku?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Memcached or Redis-to-Go

2011-01-15 Thread John Maxwell
Hi,

I was wondering how the network response differs between using Memcached or 
Redis on Heroku. I'm happy using either for caching my app, but I was 
wondering which of the services has a better link into Heroku and thus is 
likely to offer better performance? (I'm not interested in a discussion 
about the merits of one over the other, just their performance within the 
Heroku platform!)

Many thanks,

John

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.