Ams.rb Oktober

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    3 Favorites

    Ams.rb Oktober - Presentation Transcript

    1. Lessons Learned while building
    2. or... How To Run Your Big App on One Server AndAHalf
    3. Menno van der Sman Developer at Wakoopa since May 2007
    4. Wakoopa is about software
    5. PC Mac Linux
    6. 200 GB
    7. Does it scale?
    8. Scaling the front is easy
    9. Scaling the back is harder
    10. Limits spawn creativity
    11. Servers at Railsmachine 16GB RAM 5GB RAM 8 Cores 4 Cores dedicated shared staging archiving production database
    12. or... Keeping Your Database Happy
    13. Queuing processing multiple items at a time efficient cache update DelayedJob for anything else
    14. Smart queries UPDATE developers SET active_seconds = active_seconds + ... INSERT INTO hourly_usage (...) VALUES (...) ON DUPLICATE KEY UPDATE active_seconds = active_seconds + ..., idle_seconds = idle_seconds + ... Allows for concurrency
    15. Aim for a Small Rowsize choose a correct datatype pick the right indexes sometimes `id` shouldn’t be the PK
    16. composite_primary_keys Allows efficient PK class HourlyUsage < ActiveRecord::Base set_primary_keys :user_id, :software_id, :used_at ... end Original implementation by Dr Nic Maintained by Darrin Holst http://github.com/drnic/composite_primary_keys
    17. Archive old data that’s not frequently used SELECT ... FROM hourly_usage WHERE used_at < '...' INTO OUTFILE '/path/to/file' LOAD DATA LOCAL INFILE '/path/to/file' REPLACE INTO TABLE hourly_usage_storage avoids long locks
    18. Alternative solution Partitioning CREATE TABLE hourly_usage_storage ( ... ) PARTITION BY RANGE (software_id) ( PARTITION p0 VALUES LESS THAN (...), PARTITION p1 VALUES LESS THAN (...), PARTITION p2 VALUES LESS THAN (...), PARTITION p3 VALUES LESS THAN (...), .... PARTITION pn VALUES LESS THAN MAXVALUE ); Makes ‘WHERE software_id = ...’ very fast Didn’t work for us
    19. Other Techologies Rails 2.3 Apache Passenger REE 1.8.7 MySQL 5.0 Memcached Sphinx Amazon EC2
    20. Our REE settings #!/bin/sh RUBY_HEAP_MIN_SLOTS=500000 RUBY_HEAP_SLOTS_INCREMENT=250000 RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 RUBY_GC_MALLOC_LIMIT=50000000 exec "/opt/ruby-enterprise/bin/ruby" "$@"
    21. Questions? or suggestions?
    SlideShare Zeitgeist 2009

    + Menno van der SmanMenno van der Sman Nominate

    custom

    577 views, 3 favs, 0 embeds more stats

    Presentation given by Menno van der Sman from Wakoo more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 577
      • 577 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 3
    • Downloads 3
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories