There are a lot of questions on how to determine the capability of a VPS in handling the Metatrader program (including its EA), especially on the number of MT4 allowed to run simultaneously.
The answer surely depends. On one side: The basic economic principle still applies, which is “to run as many MT4 programs as you can on a most inexpensive VPS (with the smallest possible memory)”. On the other side: Would it be really possible to do so? Let’s do some reviews.
The one and only way to determine such thing as mentioned above is making some ‘calculations’. Memory is one of the most important factors on determining the ‘stability’ of a VPS. Memory among traders is not the only and the absolute influence elements. The fact that MT4 does not require large amounts of memory. Therefore, we shall only provide an exclusive package VPS Forex with a reliable CPU resources, but with limited memory capacity not like the one offfered in the hosting industry or VPS for web. Please do not exceed 10 MT4 running simultaneously in a VPS of any types!
This is a simple formula (calculation) for MT4:
Calculator for counting MT4 that can be handled by a VPS (this is an illustration only)
Memory consumption can sometimes have an anomaly (the true usage could only be "seen" 12 - 24 hours after MT4 run. Not just after we clicked and run them)
Per 1 MT4 = 200M
Per 1 chart (attached by an EA) = 100M - 300M (depend on what timeframe is used, example M1, needed more -300M, less timeframe consumed more)
Example: 3 MT4, each used 3 chart (timeframe H1, M15, and H4)
Result:
3 MT4 x 200M = 600M
2 Charts (additional) x 3 (with 3 MT4) x 100M (we take the most minimal) = 600M
Total = 1,2 GB
Well this setup requires a minimum of 2 GB package (PRO). Although our Classic package can run this type of configuration, but we are not recommending it as it is not safe (200M above 1 GB, although you may find at after running or click on all the MT4, the VPS may be sufficient to run all of them, as explained earlier about this 'anomaly').
On some occasions, especially a high impact news, there will seems to have a serious memory eater and get worst with the smaller timeframe. A sample study, like in the "Brexit Case" with an M1 timeframe: 1 MT4 with 1 chart M1 alone with the use of 512MB VPS will be collapsed. (although in our calculation there is still a possibility to do that).
Other types of Calculation
The memory capacity load calculation being used in a VPS (computer) depends on the following factors (sorted out from the biggest load to the smallest ones on memory consumption):
- The number of parallel/simultaneous MT4 programs running (the more MT4 programs running, the more they consume memory).
- The number of charts used in each MT4 programs (generally, some are using up to 10 charts, the more charts being opened, for sure, the more memory is being consumed).
- Characters (algorithms) being used by the EA.
- Time frame being used on the charts. The M1 and M5 time frames are the most memory consuming ones because of the number of history ticks per unit time.
- Open Orders. Orders which are being open at a particular time (whether it is an active order or a pending one). The more orders being opened simultaneously, the heavier it will be.
Additional IMPORTANT notes:
- Restart. The more frequent we restart the MT4 program (close/exit and re-open the MT4), the much better it will be, since the memory is being refreshed (updated/wiped/restarted), re-allocated. Even better, if the Windows VPS is also being restarted. A restart option is also recommended, even though the consumed memory has already been quite much.
- Low Memory condition after 3-4 hours. By the time the EA was being installed, the Windows didn’t show any signs of memory ‘deficiency’. But after the MT4 (and EA) has been activated/running for around 3-4 hours, it usually began to be detected by the swelling size of the used memory, and ended up by showing the message “low on virtual memory” and/or similar messages on the screen. This is mainly caused by an overloaded MT4 memory with the tick history data from the broker (which is being continuously accommodated), after running for several hours. Therefore, the smaller the time frame being used (M1 or M5), the more tick history data is going to be accommodated by the MT4 and will surely more consume the VPS memory (also refer to: “the occurrence of Low on Virtual Memory”).
- Complex EA algorithms. Please also note, that in some EAs, additional calculations are being needed on small time frames (such as in M1 and M5, which will give more load to the VPS memory). So, it is not only the charts in small time frames which are giving more load to a VPS, but also EAs with additional calculations in small time frames are also included.
- There is no such guarantee that a certain VPS could fit numbers of running MT4. Even a "big" VPS couldn't handle 1 MT4, this is from our experience, with a very complex algorithm and with around 20 chart on it (the MT4 would consumed 2,1 GB of RAM, even though it is only one MT4). So please be very careful. Economical consideration in one side, and a stability issue in the other side. If you need to know exactly how many MT4 with your settings can fit on which certain VPS spesification, please feel free and directly consult with us, free of charge.
Viewing Current Memory Allocation:
- Start >> Run
- Type taskmgr, the click OK
- Choose the Performance Tab, and view the PF Usage section on the MB amount being used (in the below illustration is 214 MB)
- The Windows would terminate the lightest main services at first, which the Remote Desktop services are not included within them, as there is a memory occupancy of up to 90 - 95% of the total Windows memory capacity. Some VPS users would be experiencing the impact, such as not being able to connect to the VPS (due to reason that Windows has already terminated the RDP service), but the connection through VNC is still possible, and the programs within the VPS are still running.
- If the VPS still can be used and is still running, the memory will continue to drain, and when there is no more main services that could be terminated by Windows (usually, when the usage threshold has reached up to 110% - Windows is able to tolerate its memory usage to more than 100%), it will start the “dumping kernel” process, which usually resulted to a fatal condition such as the BSOD (Blue Screen Of Death) or commonly experienced as a HANG condition (the computer or VPS will be frozen, nothing could be moved/operated). At this process, all programs will be in a HANG / OFF condition and sometimes file got corrupted (please be careful). The Windows will be in an ‘emergency’ condition. Besides doing a restart, there will be no other things that can be done.
- On all servers, we have been equipping them with a tool that performs an Automatic Reboot when a BSOD condition occurs. This will be reducing the possibility of a program on the VPS for ‘not running’ in a certain period of time, better than to let the VPS in a HANG / FREEZE condition (and could not be accessed through RDP).
The symptoms of the “Lack of Memory” occurrences on a VPS and a Windows-based PC, commonly could be described as follows:
On The Metratrader / MT4 program, the following simulation will explain on how the occurrence of Low on Virtual Memory on a VPS (as represent by an image below):
- As the VPS is being closed, the possibility of the Windows memory consumption by the MT4 program (which has been run lastly) has only reached up to 70% of the maximum capacity, and everything seemed to be fine. On a WINNERvps VPS, if supposed the Windows memory is being used by its “almost full” capacity, then, it would not be possible to run other programs which uses more memory resources that is being provided. This process is the first security step to prevent a VPS being overloaded.
- After a VPS has been running for 6 hours, 12 hours and 24 hours (12 hours has been commonly recognized as the most critical point), the used memory capacity will be no longer the same as the VPS was lastly being left (disconnected). Moreover, if supposed the MT4 is running on an M15, M5 or even an M1 timeframe, the memory consumption process would be far more unexpected (tends to have an increasing consumption of memory, as the amount of the tick history data are getting bigger from the brokers.
- At times of high impact news (and other important news), by the fast rate of data acceptance speed as well as the enormous amount, so does the memory consumption processes.
- To monitor these memory anomaly trends, we have develop a program called RAMUsage.exe (can be downloaded at https://winnervps.com/tools/NetTimeSetup-314.zip), which will provide assistance by sending a notification alert by e-mail when the memory consumption has reached a certain threshold (in percentage).
Recommendations (please do not take this as a benchmark, as these are only references from our experiences):
- 512 MB VPS is designated to be used by 2 simultaneously running MT4s, using 2 charts each (with its maximum time frame of M15). Avoid the usage of too many MT4 programs, use 1 MT4 with a maximum of only 6 charts (without using M15 or lower timeframe) on this low-spec VPS.
- 1,024 MB VPS is designated to be used by 4 simultaneously running MT4s (maximum 5), and/or a maximum of 10 robots (totally, including the charts), and/or 2 running MT4s with 1 for backtest.
- 2,048 MB VPS is designated to be used with 6 simultaneously running MT4s (maximum 7), and/or a maximum of 20 robots (totally, including the charts), and/or 4 running MT4s with 1 for backtest.
- Again: Please do not exceed 10 MT4 running simultaneously in a VPS of any types!
- If somehow you get caught by the LOV (Low on Virtual Memory), please use HARD REBOOT from Client Area to regain the access the VPS. Please click here for the Tutorial on Hard Rebooting the VPS.