Financial helper rails Architecture

Source: Internet
Author: User

 

Financial helper is a website dedicated to personal Fund Management in China. It provides open-ended Funds, closed-end funds, net worth of monetary funds, information, and various analysis tools, it also provides revenue management, efficiency analysis, and other services. Simple: personal investment management tools + communities.

Launch was officially launched in March. Currently, there are more than 10 million registered users. I don't know if Cai Bangzi is able to take the lead in the project applications developed by rails in China. javaeye has a lot of access traffic, and the two have a fight. It has three co-founders: Robin Lu (LU Yibin), Meng Yan (not Meng Yan of csdn, haha), and Zhao Lu. At present, it seems that there are only three of them. At present, PV has reached millions every day, with about 1.8 million rails requests every day. The total number of requests per day is about 5 million, and the number of requests per second reaches 430, rails's peak requests per second reached 160.

Financial helper background technology mainly uses Ruby on Rails, Lighttpd, memcached, MySQL, Linux, Apache 2 and other technologies. At the beginning of launch, there was only one self-assembled server. The configuration was 1 xamd opteron 250, 2g memory, 250g SATA, and RAID 1. At this time, the database and application were put together, this is basically the case at the beginning of startup. For the basic configurations, refer to those who are preparing to start a business. I started using Xeon, with 4 GB memory and 160 GB hard disk, I bought a Dell host. They use shared bandwidth at the beginning, <3 Mbps.

 

The first challenge they encountered was in February May. The problem was that some requests were time-consuming. They implemented tuning and optimized the rails cache. The second challenge was in August. The second challenge was that the bandwidth was insufficient and the bandwidth was upgraded directly to 5 Mbps. In August, the website load increased rapidly as the stock market grew. So scale up quickly, upgrade the memory to 4 GB, and use two amd2214 2.4 GB. Now the four cores are ready! The number of mongrel instances is also adjusted to 20. In March, there was a big challenge. At that time, the stock market reached, and the daily PV reached 6000. At this time, the major change was to separate the app server from the DB server, A separate machine is used to carry the DB pressure. The bandwidth is also increased to 10 Mbps, And the mongrel is added to 30 instances.

At the same time, they encountered some problems on the Load balancer, that is, the weight difference between their requests may be quite large. Therefore, they used request, traffic, or round-robin to distribute tasks, this results in poor throughput and many requests are delayed. They finally chose Lighttpd 1.5, which is mainly used to distribute requests based on load conditions. They summarized several trick:

L for Rails Applications, sometimes balancer is more important than Web server.

L disable HTTP keep-alive

L do not use mongrel to serve static files such as JS and CSS

L adjust the configuration according to your website business style.

Backgrounddrb is used in the background for distributed computing, such as fund net worth. Later, I felt it was too slow. I made an eventmachine-based fastbackground to serve as a distributed computing platform. In terms of maintenance, several tools are provided, including Google Analytics, AWStats, Munin, monit, and crontab.

We will wait and see the development of financial helpers. Through their exploration and experience in Rails Applications, I believe rails will surely shine brightly in the future. I sincerely hope they can go further and higher.

 

 

 

Author: shawnliu
Source: http://liushouzhao.cnblogs.com

 

References:

Financial helper

How to Create a rails Application

Caibangzi.com website architecture

Robin blog

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.