-3

Currently, my Rails app is working on a server with 1GB RAM. I feel it's so slow so that I'm planning to shift to better Server.

There are 3 choices such as 2GB, 4GB, and 6GB. or 2GB with SSD. Is there any big changes if I just move all the files of Rails app to there, and prepare exactly the same deployment?

Is 1GB RAM is too low for Rails? Anyone has any idea about this?

MKK
  • 97
  • 1
  • 3
    do you know what's slowing down your app? Adding ram won't matter if the the bottleneck is bandwidth or something else. – imel96 Jul 17 '13 at 01:27
  • @imel96 Thanks for a comment. I made twitter-like service. In which, every second all the status changes. For example. last signed-in time. It can be 10 seconds ago, or 15 mins ago, and so on. So I cannot use cache in my App. The more tables, and the more columns to show, it takes longer and it makes me feel so slow. For example, there are tables such as Students, BloodType, Gender, and Prefecture. last 3 tables are Master table. When I'm trying to show 10 students records, SQL will be issued for each so 3x10(student)=30 SQL queries. Isn't it making it so slow? – MKK Jul 17 '13 at 01:32
  • 1
    Sounds more like a programming issue than a server issue. 1 GB ram should be able to hold almost 1 GB of data. Database is smart enough to cache, but hitting database every time is still a slow process. Using faster cpu might help a bit but you still need to optimise your app. – imel96 Jul 17 '13 at 01:47
  • @imel96 over 50 sql are issued for each page on average. In some pages, over 100 sql. Is it too much? However, The more tables and associations, it gets slower while loading page. Just like an example in my previous comment. – MKK Jul 17 '13 at 01:53
  • I don't think it's a capacity planning issue. If you're wondering if tens of sql requests for a page is too many then you should ask in programmers.stackexchange how to solve your problem. Yes, 100 sql requests are too much as users won't see the page in 3 second. – imel96 Jul 17 '13 at 02:55
  • "When I'm trying to show 10 students records, SQL will be issued for each so 3x10(student)=30 SQL queries." Psst. Research SQL JOINs. – ceejayoz Jul 17 '13 at 03:22

1 Answers1

1

You don't need help picking a server. You need to learn how to profile your application to isolate performance issues. It is possible to cover up problems like to with a bigger server. But there is now way anyone here can give you an easy answer on how to tell which package to upgrade to. You will need to test it out yourself to find out.

See Can you help me with my capacity planning?

longneck
  • 22,793
  • 4
  • 50
  • 84
  • VERY well said. Performance issues should ALWAYS be first handled by running a profiler and finding out what the issue is. Both, on app as well as on OS level (is it ram? io? cpu?). Then making an informed decision. Asking on a public place without giving any relevant information is not the thing to do. – TomTom Jul 17 '13 at 03:51