Ihr Partner in Web-Entwicklung

Innovative Ideen für Ihr Unternehmen

Web-Entwicklung

Egal ob neue Firmen-Webseite, CRM-System oder Spezial-Software. Wir sind ihr Ansprechpartner in Sachen Web-Entwicklung!

Wir erstellen Webseiten und Web-Applikationen nach ihren Wünschen und Anforderungen. Dabei setzen wir stehts auf die neusten Technologie- und Sicherheits-Standards.

Netzwerk Administration

Planung, Aufbau und Administration ihres kleinen bis mittelständigen Firmen-Netzwerkes.

Wir kümmern uns daraum dass es in ihrer Firma läuft. Wir planen, bauen und administrieren ihr Unternehmens-Netzwerk.

Linux Server Management

Aufbau, Instandhaltung und Wartung ihres Linux-Servers.

Wir bieten ihnen einen umfassenden Service für ihren Linux-Server. Wir sorgen dafür, dass alles auf dem neusten Stand ist und ihre Services verlässlich laufen. Dabei achten wir stehts auf die Sicherheit ihres Netzwerkes und ihrer Kunden.

Wer Sind Wir?

Software ist Analyse und Instrospektion. Um einen Prozess zu verstehen, betrachten wir ihn so lange bis wir ihn verstehen. Gute Software erklärt einen Prozess in einfachen Schritten.

Wir bauen Software aus Micro-Services, kleine Komponenten die eine kleine Aufgabe erledigen. Ein Service alleine ist nahezu nutzlos, aber wenn mehrere zusammenfließen - dann können sie komplexe Prozesse abbilden und verwalten.

Viele unserer Services sind Open-Source, so das sie von der Community geprüft und verbessert werden können. Das erlaubt uns transparente und effiziente Arbeit.

Wir ergänzen diese Services dann mit anderen Services die proprietär sind, und das geistige Eigentum ihrer Firma schützen. [Mehr erfahren?]

Wir möchten das unsere Kunden das Gefühl haben das dass was wir tun ganz einfach ist. Dann wissen wir das wir es richtig machen.

César

César

Inhaber & Entwickler

Sebastian

Sebastian

Entwicker

BLOG

Wir nutzen unseren Blog um uns mit anderen Entwicklern auszutauschen. Die Softwareentwickler Community ist global, und selten Deutsch sprechend. Unsere Artikel sind deshalb alle auf Englisch verfasst. Wir laden sie trotzdem ein sich umzuschauen.

Our upgrade to PHP 7.4

27/03/2020

PHP 7.4 finally started hitting the testing repositories and therefore our local machines started upgrading to the new version. Luckily, all our software seems to have made it through the migration without any issue.

Only a small error cropped up from our usage of error_get_last and the fact that it returns null when no error was issued. So, whenever a script worked perfectly fine, we would get hit by the warning.

More info here: https://wiki.php.net/rfc/notice-for-non-valid-array-container. Basically, this means that echo false[4]; issues an error. Yes, that is valid PHP code.


Work is a bit slow, and I’ve been looking into some of the C doc around sockets intensively lately. My brain hurts now.


: 0 : engineering, php

Automate your LAMP deployments

20/03/2020

This week we created a bash-script for easier installation and deployment of a LAMP (Linux, Apache, MySQL and PHP) server. To save work and quite some time.

You can have a look at the script here:

https://phabricator.magic3w.com/P6

This script runs all necessary commands to install, configure and run each component of the LAMP-stack with a given domain.

In detail:

  • Update the system
  • Install Apache2
  • Install MySQL (MariaDB)
  • Install PHP
  • Enable mpm_event for better performance
  • Install Certbot (Let’s Encrypt)
  • Create a folder for the new website / service
  • Create a new Apache-Vhost for the given domain
  • Enable this Vhost
  • Optional: Get a SSL-certificate by Let’s Encrypt

How to use it:

Run sudo wget https://phabricator.magic3w.com/file/data/gxq5v4ctnqvlw3mwe32x/PHID-FILE-rbdmm72nkzi3trhypwjq/raw.txt -O deploy.sh to download the script.

Run sudo chmod +x deply.sh to make the script executable.

Run sudo ./deploy.sh www.example.com to run the script (just replace the domain with yours).


: 0 : engineering, phpprogramming, php, mysql, lamp, apache

Ignore errors in PHP the right way

13/03/2020

PHP has always had an error suppressing operator (the @ character). You would place it before a statement that you’d expect to cause issues and then would therefore suppress the errors generated by it.

The issue with @ is that it knows no nuance. This is why it is bad. Imagine this scenario:

include 'script-that-may-not-exist.php';

There’s legitimate reasons why a file may not exist in a system. For example, a settings file that does not exist may just expect the system to revert to defaults.

You would generally do something like this:

@include 'script-that-may-not-exist.php';

We could simply write something like this:

function suppress($lvl, $fn) {
  $old = error_reporting(E_ALL & ~$lvl);
  $_ret = $fn();
  error_reporting($old);
  return $_ret;
}

supress(E_WARNING | E_NOTICE, function () {
  return include 'script-that-may-not-exist.php';
});

This would allow the function to ignore the notice that arises from the file not existing. But if the file is included and does have a parse error, the error won’t be suppressed


: 0 : engineering, phpprogramming, php, mysql, lamp, apachephp, engineering

MPM_Event performance compared to MPM_Prefork

06/03/2020

We’ve spent the last week migrating all our servers from MPM_Prefork to MPM_Event, this allows Apache processes to have several keep alive connections for one thread just waiting to be re-enabled.

Apache achieves this by using Asynchronous IO, meaning that the server can be waiting for several sockets per thread while it’s idle.

The whole idle thing here is key. If your server is having issues with slow requests because the database or your application is taking long to respond switching to MPM Event will not only have no effect it may even make it worse.

But, if you’re like us, and the script you’re running takes just a few miliseconds to generate output and have a lot of concurrent users, you will definitely feel the difference.

In our case, Prefork was feeling the process exhaustion because of a lof of keepalive connections. And we did see some spectacular results on our servers.

We used ab to measure, our benchmarks were set to 2000 requests with a concurrency of 50. This is on top of our usual users.

One of our servers went from an average 432ms per request, to just 91ms. And a maximum of 6100ms to 312ms. This was one of those ideal candidates serving a lot of very small requests.

Our storage servers for user uploaded images went from an average 798 to an average 734, with the maximum time dropping from 4082ms to 3140ms. This is probably due to the fact that here the application does a bit heavier lifting.

I’m specially happy with the dramatic drop of the median time and the slow requests. It means that overall our users are getting a better experience and the server is not bottlenecked by waiting for keepalive connections.


: 0 : engineering, phpprogramming, php, mysql, lamp, apachephp, engineeringapache, engineering, it

Experimenting with C++ and openssl - goodbye SSLEngine

28/02/2020

Over the last few weeks I’ve been working on a project that I originally set up using Java. I generally loved the way Java writes and reads, it just feels very well thought out.

But I did hate one thing about Java, it’s “new IO” and “SSLEngine” packages. nio is by far not a new concept, the component actually dates back almost 20 years at the time of writing.

The issue I had was that it does not natively support an SSL based socket, like the standard Socket in Java does. And SSLEngine is an almost completely undocumented nightmare to work with.

My application accepts incoming sockets, and distributes a payload that it receives from an HTTP server to all the clients connected to it, using a websocket as transport.

I was a bit torn at first, because my application was working in Java, it was just limited by the fact that the system would manage hundreds or even thousands of threads if the load scaled a little further than just development.

The original application would have two threads per client, which was just an unacceptable amount of overhead for an application intended to serve hundreds of clients.

I started my work on rewriting the application, replacing the old socket system with nio channels and SSLEngine. And while the application seemed to start off fine, it would soon have issues that stemmed from SSLEngine that seemed to somehow read data that it could not handle whenever nothing was connected to it.

Eventually, the browser would start having issues and the system would become unresponsive, making the entire issue very painful.

Then I started off putting together a small test to write an HTTP Server that would support HTTPS connections using C++. In just a matter of hours I had a working prototype that actually supports receiving big POST messages without crashing the application, SSL, the connection, the cURL client or the system.

While C++ is almost completely new to me, and I have never used openssl or the poll function, it just came together after a few hours of trial and error. The SSL handshake always works and feels consistent, which gives me an overall feeling of confidence in the workings of the application.

I am assuming that all that is now left to me, is migrating the code I had in java that was working. I’m a bit scared of the whole HTTP Server part, SHA256, JSON and HTTP Requests. But I’m overall positive about it.


: 0 : engineering, phpprogramming, php, mysql, lamp, apachephp, engineeringapache, engineering, itengineering, cpp, java

Kontakt

Wir haben Ihr Interesse geweckt oder Sie möchten uns einfach eine Frage stellen?
Gerne können Sie uns eine E-Mail verfassen oder sich telefonisch bei uns melden.

Wir freuen uns auf Ihre Anfrage!

Magic3W
Pelkovenstr. 148
80992 München