+ All Categories
Home > Technology > meetPHP#8 - PHP startups prototypes

meetPHP#8 - PHP startups prototypes

Date post: 10-May-2015
Category:
Upload: max-malecki
View: 1,714 times
Download: 0 times
Share this document with a friend
Description:
PaaS providers benchmark. Silex vs Laravel4 battle. Siege tests.
Popular Tags:
30
PHP Startup Prototypes By @emgiezet
Transcript
Page 1: meetPHP#8 - PHP startups prototypes

PHP Startup PrototypesBy @emgiezet

Page 2: meetPHP#8 - PHP startups prototypes

Who am I?

● In PHP since 2003

● In Symfony since 1.2.14

● Master @ wmid.amu.edu.pl

● Tech Lead @ RedExperts

● self-employed

● Blogger & Geek

Page 3: meetPHP#8 - PHP startups prototypes

new Agenda();

$presentation[0] = 'Who am I?';$presentation[1] = 'I got an idea but have no money!';$presentation[2] = 'PAAS';$presentation[3] = 'PAAS – Providers';$presentation[4] = 'Costs?';$presentation[5] = 'Application';$presentation[6] = 'Silex';$presentation[7] = 'Laravel4';$presentation[8] = 'Our cloud is under siege!';$presentation[9] = 'Charts and other crap';$presentation[10] = 'Q&A';$presentation[11] = 'Tank You!';

Page 4: meetPHP#8 - PHP startups prototypes

PaaS == Platform As A Service

● Focused on application● No additional infrastructure required● Deploy and Forget● Load Balancer? Who needs the load balancer?● No admin support needed anymore! Sorry guys.

Page 5: meetPHP#8 - PHP startups prototypes

PHP friendly PaaS - Providers

Page 6: meetPHP#8 - PHP startups prototypes
Page 7: meetPHP#8 - PHP startups prototypes

appfog● Evolves from PHPFog● After Deployment Scripts● Easy to deploy● Additional Services Config available via get_env();● Gem application to deploy your app● 2GB of RAM for your apps for free!● Up to 10 Services for your apps free!● Time to time throws 500 on appfog panel.● Cannot write to disk of instance for ex. file uploads

or file cache.● No auto scaling

Page 8: meetPHP#8 - PHP startups prototypes

Engine Yard - Orchestra

● Deploys straight from repository(Git and SVN)

● Production database need to be hosted on AWS - $$$

● Only orchestra sub-domain

● Only free add ons at free plan

● 1 concurrent connection – our siege tests are ruined!

● No auto scaling

Page 9: meetPHP#8 - PHP startups prototypes

heroku

● Cloud level: “Asians”● Based on ngnix● Dev DB up to 10k rows is free● Production DB starts from $9 /

mo.● Only 1 instance is free● Needs special a “buildpack”

Page 10: meetPHP#8 - PHP startups prototypes

OPENSHIFT

● RedHat based must be awesome!● Build on Zend Server● 3 small “gears” 512 MB RAM for free!● Each “gear” can have MySQL, MongoDB,

PostgreSQL, phpMyAdmin etc.● Free application can have auto-scale feature

and fill all the 3 gears available on the traffic peak.

Page 11: meetPHP#8 - PHP startups prototypes

Costs?!

Page 12: meetPHP#8 - PHP startups prototypes

PAAS – Providers Free PlansFeature Orchestra Heroku OpenShift

RAM 2GB ? ? 512MB / inst.

Storage 1 GB / inst. 2$ / mo. Dev s3 1GB / inst.

MySQL

Up to 10

Shared DB 10k rows 1 / instance

MongoDB ?$ / mo. 496 MB 1 / instance

Redis X 100 MB X

Memcached X X 1x 25 MB X

Location US,Europe,Asia US West Cannot select Cannot select

Instances Up to 16 2 1 Salable up to 3

Deploy by gem af from git by toolbelt by gem rhc or by jenkins

My Grade: 4+ 2 3 4

Page 13: meetPHP#8 - PHP startups prototypes

Application

● Routing and ORM based.● Cloud friendly – easy to scale horizontally,● Database filled with 10k of random records● One controller displays the data from the DB● Composer based installation ( I wish be there )● Big frameworks aren't supported (mostly) ;(● So let's go with micro-frameworks!

Page 14: meetPHP#8 - PHP startups prototypes

Cloud friendly Application? WAT?

● Can use Master/Slave DB Connection.● Gives ability to store session in DB/Memcache/Redis

because sticky session sux hard by keeping user only at single instance/node while session is valid.

● Can use external storage for uploads (ex. Amazon S3 bucket)

Page 15: meetPHP#8 - PHP startups prototypes

Micro-frameworks

Page 16: meetPHP#8 - PHP startups prototypes

Silex

● Build on symfony2 components!

● Uses TWIG● Has lot's of extensions● Easy to use for symfony2

developers● Cloud friendly!

Page 17: meetPHP#8 - PHP startups prototypes

Laravel 4

● Also uses symfony2 components,

● Well documented,● Light weight,● Popular● DBAL – not so great

Page 18: meetPHP#8 - PHP startups prototypes

Let's build the APPs!

● One controller with one action● Display the data● Add a memcached if available● Create a fixtures or dump to fill

the database!● Deploy the apps in to the cloud!

Page 19: meetPHP#8 - PHP startups prototypes

But before we deploy them...

● We need to create our apps in the PAAS Cloud!

● Configure the build,● Add a resources(RAM,

additional services),● Load Balancing? Forget.

PAAS has LB build in!

Page 20: meetPHP#8 - PHP startups prototypes

Our Cloud is under siege!

Page 21: meetPHP#8 - PHP startups prototypes

Siege Config

● 15 concurrent users● 1 minute of siege

Page 22: meetPHP#8 - PHP startups prototypes

Siege Results

Results appfog Engine Yard heroku openshift

Framework Silex Laravel4 Silex Laravel4 Silex Laravel4 Silex Laravel4

Transactions 1050 863 N S ? ?

Availability 97.31 96.42 A E ? ?

Data transferred 7.44 MB 8.48 MB T L ? ?

Response time 0.31 s 0.51 s U E ? ?

Transaction rate 17.77 14.59 R C ? ?

Concurrency 5.44 7.5 A T ? ?

Successful transactions

58 67 L I ? ?

Failed transactions:

29 32 - O ? ?

Longest transaction:

4.95 8.23 - N ? ?

Page 23: meetPHP#8 - PHP startups prototypes

Charts!

Page 24: meetPHP#8 - PHP startups prototypes

AppFog

Availability:Data transferred:

Transaction rate:Response time:

Throughput:Concurrency:

Successful transactionsFailed transactions:

Longest transaction:Shortest transaction:

0

20

40

60

80

100

120

Laravel4

Silex

Page 25: meetPHP#8 - PHP startups prototypes

Conclusion

● Orchestra - free plan is not enough even for startup-fest. It will lag on final pitches.

● AppFog - ● Heroku - ● Openshift● Silex – Fastest! For Symfony2 developers the best choice!● Laravel4 – Weirdo DBAL. Fast but silex kicks his ass.

Page 26: meetPHP#8 - PHP startups prototypes

Conclusion

● Orchestra - free plan is not enough even for startup-fest. It will lag on final pitches.

● AppFog – Easiest!● Silex – Fastest! For Symfony2 developers the best choice!● Laravel4 – Weirdo DBAL. Fast but silex kicks his ass.

Page 27: meetPHP#8 - PHP startups prototypes

Engine Yard - Orchestra

Plus:● Well documented

Minus:● Free plan is not enough

even for startup-fest. It will lag on final pitches.

Page 28: meetPHP#8 - PHP startups prototypes

Heroku

Plus:● Super rich add-ons market!● Most of the add-ons have free plan!● Easy to configure●

Minus:● Only one node for free● Deployment Massacre

Page 29: meetPHP#8 - PHP startups prototypes

Q&A

● Dare to ask!

Page 30: meetPHP#8 - PHP startups prototypes

Recommended