phpworld

Making Magento go fast by Thijs Feryn @ThijsFeryn at #phpworld

Making Magento go fast by Thijs Feryn @ThijsFeryn at #phpworld Magento can be a little slow, but it's tremendously flexible.

Presenting today from the perspective of a hosting company employee who knows a lot about PHP but not a lot about Magento and approached it from a hosting/operational standpoint.

Remember the basics - activate caching, flat catalogs and JS & CSS minifcation.

The Magento compiler is a lie - it's invented for people who have no bytecode caching, but everyone should have that now.

Magento cache by default is on the disk - var/cache/

Move the Magento cache to somewhere faster. Could try APC or memcached. Memcached support allows multiple servers.

Magento uses a 2-level cache, a fast backend (adapter) and slow backend (disk).

You can put your slow backend (var/cache)on tmpfs.

PHP is slow - especially the older versions.

Remember - many types of PHP caching doesn't work well with fast-cgi because everything is in multiple, separate processes. Every process has its own APC cache.

With php-fpm you can configure a master process that stores the byte code cache so each child process uses same cache.

Opcache is awesome and a lot faster than APC.

Get all of your caches in memory!

The database is important for Magento performance - give MySQL more RAM. MySQL should use 80% of your database server's memory.

If you have lots of traffic to Magento, try turning off query caching and use the memory for the buffer pool and other uses in MySQL.

Check the setting innodb_flush_log_at_trx_commit - try to change it to 2 or 0.

Setup 2 database servers - one for reads, and one for writes.

Redis is GREAT - use it! Redis has built-in deplication, multiple data types, doesn't require a 2-level cache.

Store your sessions in redis so that sessions are shared between all of your web nodes.

Varnish is fast and scales - sites have powered 40 million users per day with only 2 Varnish servers.

Varnish only works on static items - product catalog and CMS pages. Not on checkout. It's great for static content, but it doesn't have SSL support. You have to terminate SSL before it gets to Varnish - use something like haproxy or nginix.

Look at using Turpentine - it allows you to use ESI or AJAX with Varnish and Magento.

If you can't use Varnish, use Lesti FPC.

If you're using Varnish or LestiFPC, turn off the visitor log tables, because they are no longer accurate. Convert them to blackhole tables.

Magento's default search can be a full-text search on the database - replace this with something better. Try using elasticsearch.

Host static files separately on a CDN.

Use Redis "clustering" to remove Redis as a single point of failure. Try Redis-cluster or Redis Sentinel - there's a Redis Sentinel patch for Cm_Cache_Backend_Rails.

 

What is new in Magento 2 with Tobias Zander @airbone42 at #phpworld

What is new in Magento 2 with Tobias Zander @airbone42 at #phpworld Ever since October 4th of 2013, the Magento 2 team has been pushing weekly updates to GitHub.

Magento2 is built on HTML5, CSS3, jQuery, LESS, requirejs. This means that Magento 2 won't support IE8.

Layout configuration is changing in Magento 2. Breaking the XML files into multiple files to make it easier to find what you need to change.

Unlimited theme fallbacks are coming in Magento 2.

Magento 2 currently has support of PHP 5.4 & 5.5. PHP 5.6 support will be coming soon.

Magento 2 follows PSR-0, PSR-1, PSR-2 and uses real namespaces.

XSD support for XML files is coming to Magento 2.

New file structure in Magento 2 so that modules have one folder, no need to install modules into multiple folders.

Magento 2 has Composer support. You can install Magento 2 from Composer.

Added the Service Layer to make things more reusable and easier to extend. More details at https://alankent.wordpress.com/2014/05/22/magento-2-service-layer/)

Dependency injections and interceptors are coming to Magento 2.

There’s great improvements coming for admin users in Magento 2 as well - adding products is MUCH simpler.

Magento 2 consists of 1.5 million lines of code currently. 2,600 integration tests. 7,600 unit tests. Not complete code coverage, but significantly better than Magento 1 which shipped with no coverage at all.

100 JS unit tests, over 100 static tests including PHP mess detector. 9 performance tests.

phpworld keynote: Turning Your Code into a Company: The Parts They Don't Tell You by Luke Stokes

Turning Your Code into a Company: The Parts They Don't Tell You by Luke Stokes - @lukestokes. Founder, CTO of Foxycart. Founded in 2007. Goal was to provide income for his growing family.

Starting a company is hard - it took 4 years of working full-time and then building Foxycart in the evenings and on the weekends, working as much as 10 hours on Saturdays. Don't believe the hype on TV - Shark Tank isn't real life. It's hard to build a company. But it's worth it!

A human being should benefit from what you do as a developer.

There's no such thing as an overnight success.

Getting "funded" is not a destination.

Build a business, not a startup.

Think about what do you believe - what will keep you motivated at 2AM?

Your focus has to be about the customer.

Belief that commerce technology makes the world a better place kept Luke going as he built FoxyCart.

Coders are insecure - we have a habit of hiding our code away. Don't be! Every failure is a step closer to success.

As a developer: solve problems, add value, keep learning.

Listen to your customers!

Motivation - passion is required, but it isn't enough. Who will talk you off the ledge? Think about paying customers. Encourage each other.

There's no glamour at 2AM - building a business is hard.

Solve real problems - if you'd pay for it, others might also.

How did Luke get to where he is with Foxy cart: slow and steady, grow the team with awesome people, focus on the product.

Focus on the product. Build a solid development team, not a sales or marketing team early on.

Fear can be healthy - don't make the jump to full time with your new company until revenue is a nice, consistent positive number.

There's great tools out there to help you build your company now. Check out http://bit.ly/foxytools for some recommendations.

php[world] opening remarks

Eli is opening up php[world] with the opening remarks. Welcome to the first PHP[WORLD]!

The goal is to bring the entire PHP community together.

Get out there and talk to people from other platforms/communities that are here today.

Twitter hashtag is #phpworld

WiFi is Sheraton_Conference, user: php14, password: sheraton14

Game night tonight, open source hackathon tomorrow night.

Open spaces - sign up for a slot. You don't have to be an expert on the topic, just talk about something you're interested in.

Please use join.in - https://joind.in/event/phpworld - provide feedback on all of the talks.

Visit the User Group Alley to learn more about some of the user groups that are represented here.