Here are some comparative benchmarks of our API using PHP-FPM vs Laravel Octane (Swoole) endpoints.
Test Hardware - Setup
- Macbook Pro (15-inch, 2018) - 2.6 GHz 6-Core Intel Core i7. 32 GB 2400 Mhz
- MySQL - 8.0
- PHP - 8.0.3
- Laravel - 8.83.5
I wanted to quickly take Laravel Octane beta for a spin, as we have been using Swoole for some time and wanted to see how official support performs vs what we have.
Next test is more real world as we now have a web server and database server within a VPC.
Using Laravel Forge
$ composer require itsgoingd/clockwork --dev
If you are running the latest Laravel version, congratulations you are done!
By default, Clockwork will only be available in debug mode, you can change this and other settings in the configuration file. Use the vendor:publish
Artisan command to publish the configuration file into your config directory.
{ | |
"title": "MacOS -> PC Shortcuts", | |
"rules": [ | |
{ | |
"description": "Top/bottom of document (ctrl+home/ctrl+end)", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": <%= from("home", ["command"], ["any"]) %>, | |
"to": <%= to([["up_arrow", ["left_command"]]]) %>, |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
# vim /etc/sysconfig/iptables | |
# | |
*filter | |
:INPUT ACCEPT [0:0] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [0:0] | |
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
-A INPUT -p icmp -j ACCEPT | |
-A INPUT -i lo -j ACCEPT | |
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT |
#!/bin/bash | |
# | |
# Carries out a full mysqldump, calls percona-xtrabackup and then | |
# copies the sql dump, the percona backup and your mysql bin logs | |
# to S3 using s3cmd http://s3tools.org/s3cmd | |
# | |
# TODO: extract out the S3 backup stuff to make it optional, and so | |
# other s3 programs can replace the s3cmd call. | |
# TODO: the if [ $? == 0 ] alert blocks should be a function | |
# TODO: make the if [ $? == 0 ] if [ $? != 0 ] more consistent - test |
var util = require('util'); | |
var events = require('events'); | |
var redis = require('redis'); | |
var RedisQueueConsumer = function (port, host) { | |
events.EventEmitter.call(this); | |
this.port = port || 6379; | |
this.host = host || '127.0.0.1'; | |
}; |