Categories
Scalability Web API

Slim Vs Silex – API performance

Slim php framework is faster than Silex

 

Silex Framework

[[email protected] silex]$ ab -n500 -c11 ‘http://silex.davidr.sbx.over.com/hello/raleche/’
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking silex.davidr.sbx.over.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests

Server Software: Apache
Server Hostname: silex.davidr.sbx.over.com
Server Port: 80

Document Path: /hello/raleche/
Document Length: 300 bytes

Concurrency Level: 11
Time taken for tests: 5.648 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Non-2xx responses: 500
Total transferred: 259000 bytes
HTML transferred: 150000 bytes
Requests per second: 88.52 [#/sec] (mean)
Time per request: 124.261 [ms] (mean)
Time per request: 11.296 [ms] (mean, across all concurrent requests)
Transfer rate: 44.78 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 61 122 20.2 120 226
Waiting: 61 122 20.2 120 226
Total: 61 122 20.2 120 226

Percentage of the requests served within a certain time (ms)
50% 120
66% 128
75% 133
80% 137
90% 146
95% 161
98% 170
99% 173
100% 226 (longest request)

 

Slim framework

[email protected] silex]$ ab -n500 -c11 ‘http://slim.davidr.sbx.over.com/hello/raleche/’
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking slim.davidr.sbx.over.com (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Finished 500 requests

Server Software: Apache
Server Hostname: slim.davidr.sbx.over.com
Server Port: 80

Document Path: /hello/raleche/
Document Length: 890 bytes

Concurrency Level: 11
Time taken for tests: 4.672 seconds
Complete requests: 500
Failed requests: 0
Write errors: 0
Non-2xx responses: 500
Total transferred: 536500 bytes
HTML transferred: 445000 bytes
Requests per second: 107.02 [#/sec] (mean)
Time per request: 102.781 [ms] (mean)
Time per request: 9.344 [ms] (mean, across all concurrent requests)
Transfer rate: 112.14 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 41 85 38.1 83 869
Waiting: 41 85 38.1 83 868
Total: 41 85 38.1 83 869

Percentage of the requests served within a certain time (ms)
50% 83
66% 89
75% 93
80% 96
90% 101
95% 109
98% 115
99% 126
100% 869 (longest request)

 

 

 

Categories
Web API

David Raleche – Professional Traits

o For Engineering Managers Specifically: I managed teams of 5+ engineers on product development. Don’t need to be hands on themselves, but need to have managed a team where the engineers were building a product built in PHP

· Experience with highly-transactional systems

· Experience with distributed systems

· Experience with RESTful web services and API experience

· Database platforms experience

· Understanding of AWS

Categories
Web API

Force git push:

Force git push:

git push origin +master

Categories
Web API

GIT RESET ALL FILES

-- force discard local changes —
git reset --hard origin/master
-- force discard —
git reset --hard origin/<davidBranch_name>
Categories
Web API

Simple PHP Send an email

yum install php7-pear.noarch

Pear Install Mail – David Raleche

– pear7 install mail

– pear7 install net_smtp


<?php
$email_from = "[email protected]";
$email_subject = 'test subject ';
$email_message= 'test message ';


// Pear Mail Library
require_once "Mail.php";

$from = '<[email protected]>';
$to = '<[email protected]>';
$subject = 'Hi!';
$body = "Hi,\n\nHow are you?";

$headers = array(
    'From' => $from,
    'To' => $to,
    'Subject' => $subject
);

$smtp = Mail::factory('smtp', array(
    'host' => 'ssl://smtp.gmail.com',
    'port' => '465',
    'auth' => true,
    'username' => '[email protected]',
    'password' => 'test!'
));

echo "DAVID<br>";
echo $mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
    echo('<p>' . $mail->getMessage() . '</p>');
} else {
    echo('<p>Message successfully sent!</p>');
}
?>
Categories
Symfony Web API

Symfony profiler – Remove PHP Warning and PHP Notice errors

modify following file -> /web/app.php

Add following arguments

use Symfony\Component\Debug\Debug;

Debug::enable(E_ERROR);

$kernel = new AppKernel($environment, true);
Categories
Apache Symfony Technical Web API

Performance Symfony Loading

ab – Apache HTTP server benchmarking tool

ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.

See following website : https://httpd.apache.org/docs/2.4/programs/ab.html

ab -n500 -c20 -H

Categories
Technical Web API

API Vs SDK

API is an interface that allows software programs to interact with each other, whereas a SDK is a set of tools that can be used to develop software applications targeting a specific platform.

Categories
Web API

Swagger tool

Easy to implement and easy to use for cross functional team QA, producer and project manager

Categories
Web API

Web API Client

Postman has been the most reliable api client so far. It has proven efficiency and effectiveness ove rtime.

restlet client

Restlet has proven not reliable at many occasions. To reset the application the only solution was to uninstall and reinstall the plugin to chrome