by Devin Yang
(This article was automatically translated.)

Published - 1 year ago ( Updated - 1 year ago )

Although we may use websites such as speedtest to test the speed of uploading and uploading, what if we want to test the speed of our own Server?
For example, if the user is in another country, the speed of connecting to our host is slow, then the self-hosted test tool is very convenient.
The latest version of phpenv has added openspeedtest.yml to the yml file of services.

version: '3.6'
services:
 fastapi:
  image: openspeedtest/latest
  ports:
    - ${HTTP_PORT-3000}:3000
  restart: unless-stopped
  networks:
    - dlaravel_net
networks:
    dlaravel_net:

We can use one line of docker command to start, you can check it on the official website, I copied it for you as follows:

docker run --restart=unless-stopped --name openspeedtest -d -p 3000:3000 -p 3001:3001 openspeedtest/latest

In fact, it is very simple. Here is the process of using phpenv to start. How do I do it? 1. Because I want to use an independent environment, I use the following command to make a soft link to services/openspeedtest.yml and put it in the upper directory.

ln -s services/openspeedtest.yml ost.yml

Set the name yourself, I will call it ost.yml, the actual execution screen is as follows:

2. Because my phpenv has a large number of environment configuration files, I can use the following command to check those ./ports that are useless to me, so conflicts must be avoided.
There will be a bunch of ports in the configuration file in envs, because there are too many, we can add a filter.

./ports |grep HTTP_PORT

The operation screen is as follows:

In the figure above, the port numbers listed in the ./ports command in phpenv will be arranged in order from small to large. I can probably see that 1061 should be available.
3. Here I will use the Linux netstat command to verify again to confirm that 1061 is not Listened.

sudo netstat -ntlp|grep :1061

On the contrary, if the connection port is enabled, it will be displayed on the screen, similar to the one below, how to tell, just change the connection port that will not flush🥲

Under normal circumstances, it should not rush to this port, it will look like the following.

4. Set the environment configuration file of openspeed, specify the yml file used, the project name and the opened port.
Here I named it openspeed and put it in the envs directory.

DEFAULT=ost
PROJECT=speedtest
HTTP_PORT=1061

The actual screen is as shown in the figure below. DEFAULT=ost represents the soft link ost.yml I executed in the first step above.

After completing the configuration file, we can switch the environment, execute ./link, and switch to the openspeed environment.

As you can see in the services/openspeedtest.yml above, it directly uses the official image (openspeedtest/latest), so we don't need to build it, just start it directly.
5. Execute the ./start command to start the environment. If there is no image, it will be downloaded automatically. If there is an image, it will be started directly.

./start

Actual operation screen: (use ./start to start, use ./console ps to view status)

6. Test it directly on another computer. Here I use the intranet test. Press Start on the screen to test.
Because I have a 10G network, the measured value is close to 10000Mb, which seems normal. 🥹

Tags: openspeedtest docker phpenv

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


docker,container,laravel

Manually update the full record of D-Laravel's user id on Nas

This article fully records how I update the uid of the fpm image on my Nas. In this article, you should learn to query related concepts such as container id and commit container.

docker,Synology

How to modify the logging driver of Docker on Synolog NAS

On my Synolog Nas, a strange logging driver named db is running by default, how to modify it to a normal json-file? In Synolog's Nas, his Daemon config file is special, and it is placed in the /var/packages/Docker/etc/ directory. Called dockerd.json.

d-laravel, docker, laravel, docker-compose

D-Laravel v1.0.0 release change description

In order to allow the container to be used more flexibly, D-Laravel has released version v1.0.0, which is not backward compatible. https://github.com/DevinY/dlaravel/releases/tag/v1.0.0 If you are using before v1.0.0, you need to modify the .env file of the Laravel project, change DB_HOST=127.0.0.1 to DB_HOST=db If you have a custom docker-compose-custom.yml file....more