Как определить который направление масштабировать веб-приложение

Идеальный путь состоял бы в том, чтобы использовать VLAN.

Но, если у Вас нет оборудования, которое будет поддерживать VLAN, Вы можете делать это через единую сеть без VLAN.

Можно поместить несколько дюйм/с на единственный интерфейс, но обычно система маршрутизатора заметила бы, что и источник и место назначения для пакетов находятся в том же интерфейсе. Необходимо будет отключить это, это называют перенаправлением ICMP. Можно отключить его в рассматриваемом интерфейсе путем записи "0" в файл /proc/sys/net/ipv4/conf/<ifname>/send_redirects.

WAN и LAN должны будут иметь различные блоки IP-адреса, и необходимо будет также почти наверняка отключить DHCP на маршрутизаторе WAN или настроить его, чтобы только дать адреса машине маршрутизатора Ubuntu.

Можно также столкнуться с проблемами с другим широковещательным трафиком или многоадресным трафиком, но это будет, вероятно, работать на некоторые ситуации. Однако поймите, что это - очень необычная конфигурация и, вероятно, потребует, чтобы некоторый futzing взялся за работу.

1
задан 26 March 2013 в 09:58
1 ответ

This question would be nearly impossible to answer in it's current form because it's too broad of a subject. The things required to answer this involves a whole field of engineering where people make a living doing full time (including myself). IMHO, it's part science and part art, and you'll find multiple books (per my colleague) out there that talks about this subject.

Therefore, I can only provide a few brief, broad pointers.

  • There is no single formula to determine the best direction to scale. Given multiple applications with the same metrics captured and forecasted, the way to scale them may be entirely different. It really all depends on where the bottlenecks are based on application (mis)behavior.
  • The best way is really test and measure. Make sure your application is instrumented so that you can test the application with varying loads and observe/measure the effects on ALL its resources (server, network, etc.). You'll also need to test as you scale in varying directions.
  • From experience, most web app scaling issues aren't even (or shouldn't be) solved by throwing more hardware/resources at it. More often than not, it's the code and its inefficiencies (which I classify as a defect)

With that said, if I were to do all that and need to pick one hosting solution, the one with the most flexibility and capability, both in terms of product offering and ability to control costs, is Amazon Web Services (AWS). It's the only hosting provider I've used that comes close to big corporate datacenters and provides most of the features I was looking for. Key features are:

  • You can actually host your application there to start with at no (or nearly no) cost using their free tier
  • You can scale vertically (increase CPU and memory on a single host) with a few clicks and a reboot
  • You can scale horizontally (of course) with more servers and other dependent services (such as load balancers)
  • They have many other services beyond VM hosting (EC2 service is just one of their services)

I have no experience with other IaaS providers (Rackspace, Microsoft Azure, etc.), so I can't compare nor contrast them. Perhaps this will help get you down some road to start your research.

Disclosure: At the time of writing this answer, I do no own any shares of Amazon stock or work for them =)

1
ответ дан 4 December 2019 в 00:44

Теги

Похожие вопросы