Did you Know Raspberry Pi 3 Can be Used as a Web Server?

April 26, 2016 / General Discussion

Well, you read rightly – the Raspberry Pi 3 can be used as a Web Server. Even for relatively high loads. The only difficulty is the lagging storage.

The Raspberry Pi Foundation is very confident in the effectiveness of its ARM solutions. More than an educational tool for Geeks, the organization sees the Raspberry Pi as a new form of a system, able to hunt on the lands of traditional desktops machinery, or servers.

“Can you replace your $10,000 server with a $35 or $40 machine? The answer was no until now”, said the Foundation. With Pi 2 and 3 things, however, seem to be able to change.

Thus, during the launch campaign of Pi 3, it was added as reinforcement of the existing server infrastructure. 5% of queries were redirected to a Pi 3 and 3% to a Pi 2. Redirect tests – 25% of traffic to the Pi 3 was conducted successfully and without any noticeable slowdowns.

In 12 hours 1.5 million requests

On the launch day of Pi 3, traffic exploded on the Foundation’s blog. The Raspberry Pi 3 used in server mode planted after 12 hours and served 1.5 million requests. Isn’t this astonishing? Obviously, it involves a saturation of RAM, which led to the use of the swap, which itself caused the corruption of the SD card installed in the machine.

The Raspberry Pi3 assured its role but suffers from the weakness of its inputs and outputs to become an actual web server that should be able to withstand heavy loads. Optimization of server configuration would certainly have prevented the use of the swap.

But the solution can only come from the storage system. For example, an SSD connected via USB shows less ready-to-plant. SATA port could, however, change this. Perhaps in the Raspberry Pi4, who knows?

The Raspberry Pi 3 overclocked to 1.5 GHz

With a little trick, the turbo becomes available on the Raspberry Pi3, which can then show up to 2 times swifter than the Pi 2.

The Raspberry Pi 3 was presented there just a week and it cleared 64-bit. On the Menu, an ARM processor with 4 cores running at 64-bit 1.2 GHz. A very effective offer, but that doesn’t give its full potential on all operating systems.

With the latest firmware, the Raspberry Pi3, like its predecessors, indeed starts at 600 MHz, in order to limit the heat. This is the OS to consider for the rise of the processor’s frequency, according to the charge and the temperature of the chip.

Operating systems do not ensure this operation (for example, RISC OS) and thus show a greatly reduced CPU score.

Forcing the Turbo Support

For the Raspberry Pi 2, the solution was simple: switch to 900 MHz, via directives “force_turbo=1” and “arm_freq=900”, found in the config.txt file of the firmware. For safety, sticking small heat sync SoC, which then still running at full speed is recommended here. With the Pi 3, this is not possible because the overclock is not allowed, at least not officially.

“Avoid_warning=1” allows not to display the alert indicating a lack of energy or excess heat. “Avoid_warning=2” does the same, and allows overclocking when the voltage is insufficient. In practice, it makes it possible to overclock Pi, in all cases. And the BCM2837 component is rather good at it. Significantly colder in charge of the BCM2836 Raspberry Pi2 (average 60 ° to 1200 MHz), it promises great opportunities.

Real Performance Changes

Thus, the RISC OS users could push the machine to 1.5 GHz, and though the life of the whole machine would be affected, the results are there. RISCOSmark with a score of 1672%, the Cortex-A53 allows the Raspberry Pi3 to clock 1.5 GHz and 27% faster than the Cortex-A9 chip that clocked at the same frequency. It is also 2.5 times faster than Pi 2 overclocked to 1 GHz.

The site Phoronix has provided the first speed tests with 1.2 GHz Raspberry Pi 3. A frequency of 1.5 GHz should be able to boost those results, they remain already very good, although much lower than those won by bullets in Cortex-A57. Here are the data from those benchmarks:

  • Massive calculations: 1.6 times faster than Pi 2 and 7.8 times more than Pi 0
  • Encryption: 1.7 times faster than Pi 2 and 7.4 times more than Pi 0
  • Raytracing: 1.6 times faster than Pi 2 and 9.2 times more than Pi 0
  • FLAC compression: 1.4 times faster than Pi 2 and 2.7 times more than Pi 0

The 50% to 60% of performance by the Raspberry Pi thus appears there. The good news is Pi 3 can do it at 1.5 GHz, which is two times swifter than Pi 2.