Improve Speed of website (On the Openshift platform) - memcached

I have an application that is gaining a lot of users quickly. It is a website set up with cartridges PHP 5.4, MongoDB 2.4, MySQL 5.5, RockMongo 1.1 and Cron 1.4.
What are the best ways of monitoring so I can evaluate what is slowing the site. I would like to know this so that I can see what I should improve.
I have come up with 3 options so far:
-Cache the calls to the sever, Memcached and Infinispan are 2 that I found
-Increase the gear size, currently small.
-Use a CDN, possibly Cloudflare
Are there any options that I have missed and what should I take into account when deciding what to do.

You could setup a scaled application so that the number of web gears in use would go up as you get more traffic. If you do that, you should use a medium or large gear for the database.

Related

Magento2.0 Server requirements - Need Guidance

We are using Magento2 for one of our projects. On our site there are approximately 2000 customers and around 3000 products right now. We are using Magento CE V 2.0.7.
It seems that our website is slow. Magento2 takes around 6 seconds to process the first byte.
According to GTMatrix, our Page Speed is 61%. Don't know why the site is slow.
We have to improve our page speed and we already followed some instructions from GTMatrix.
Few things about the server configuration:
AWS t2.large instance.
8GB RAM
2vCPU
Server is VPS.
Is this configuration sufficient for Magento 2? Or does Magento need some more configuration?
Is it possible that because of this it affects on Page Speed & Website Performance?
8GB RAM and 2CPU on AWS VPS should be more than enough to run Magento 2 in good conditions and at a reasonable speed. See here official documentation about this: https://devdocs.magento.com/guides/v2.2/install-gde/system-requirements-tech.html
Magento 2 needs though quite a lot of configuration in order to be fast. Think about advanced cache options such as Memcached, Varnish and Redis.
We are using since more than a year now Cloudways because of their integrated solutions with all those options included plus one-click-install, staging automation, CDN, free migration and 24x7 Live chat support. On a Digital Ocean VPS with 8GB RAM which is slower than an AWS VPS with same RAM we are getting quite good load times on Magento 2.2 websites template based or custom made.
You must of course also go through all possible frontend speed optimisation like:
merge and minify all CSS and JS files.
optimise all image sizes.
use CDN if needed.
Gzip compression
See more details about Magento frontend optimization HERE.
Using the latest version Magento CE 2.3 will definitly help as versions 2.0.x had a lot of speed related issues.

MongoDB each each cluster is on a different server or that they all in one

I am starting to use MongoDB and yet I am developing the first project with this. I can not to predict how volume of clients and usage it gonna to receive but I want to develop it from the beginning to be high volume handled.
I have heard about clusters and I saw the demonstrations in MongoDB official website.
And here is my question (cutted to small semi-questions):
Are clusters are different servers or that they are just pieces of one big server?
Maybe it seems a bit not related, but how Facebook or huge database handles its data across countries? I mean, they have users from Asia and from America. Surely with different servers, how the system knows how to host, aggregate and deliver with the right server? Is it automatically or that it is a tool that a third party supply to such large databases?
If I am using clusters, shall I still just insert the data to the database and the Mongo will manipulate them in cluster by it's own, or shall I do that manually?
I have a cloud VPS. Should I continue work with this for Mongo or maybe I should really consider about AWS / Google Cloud Platform / etc..?
And another important thing is: Im from Israel, and the clouds I have mentioned above are probably from Europe at least or even more far.
It will probably cause in high latency, is not it?
Thanks.

How to setup a scalable environment for the MEAN stack on AWS?

I'm developing a web app on the MEAN stack (and probably other stuff, like some way of storing images).
In the startup accelerator I'm working in I've been suggested to let go the IAAS approach for a PAAS one (namely AWS). I must admit being used to working on small scale apps on single virtual machines I'm very confused about how to approach the task and the whole PAAS thing.
Reading through AWS documentation looks like Elastic Beanstalk is the way to go for building a scalable web app. From my understanding it abstracts away the infrastructure management workload taking care of load balancing and resource scaling.
I decided to give it a try.
Now I'm a bit confused on how to setup the infrastructure. Particularly I'm wondering how to fit MongoDB it the puzzle.
I guess I shouldn't install it on the node.js machine but on a different one, so that the two can scale out depending on needs.
My questions are:
where and how should I install Mongo?
should I let go MongoDB in favour of something like DynamoDB? in this case how can I set up a local development environment?
Any suggestions would be appreciated.

google compute engine files for HA LAMP are not there for download?

I found this guide in the google documentation for the cloud platform.
https://cloud.google.com/developers/articles/high-availability-lamp-stack-on-google-compute-engine
although the files it asks you to download, are not found when the link is clicked?
anyone know where they actually are?
Unfortunately we deprecated this sample application as it was focused on migrating applications around maintenance windows.
Now that we have live migration and transparent maintenance windows, developers no longer need to move components of their application around zones due to impeding maintenance. Additionally, Cloud SQL now supports MySQL wire protocol which significantly reduces the complexities of managing applications for high availability.
In the future we may develop a new application, but it will be greatly simplified since we can offload load balancing to Compute Engine load balancer and persistency to Cloud Datastore and Cloud SQL.

Playframework 2 in the cloud

I started with python on google app engine 3 months ago.
Then I switched to Play2! on Heroku + mongodb and it is a breeze to work with.
I am really far in my project and I want to release the website in the next couple of days. But I just saw the pricing for SSL on heroku, which is really high.
And I don't want to launch my website without SSL. SSL on heroku costs $20/month without the certificate.
I saw some alternatives in this post What cloud platform supports playframework 2.x deployments?
But I am still not too happy. I want to pay as little as possible to start my website.
So at the moment I am looking on Google App Engine again. This would mean that I have to rewrite my whole DB.
Does GAE restrict some features of play2?
I also saw dotcloud but their pricing page is really confusing. I don't know how far I can go with the sandbox mode, and there is a mark on SSL so I think its somehow included but there is also an SSL addon which doubles the price.
I am okay if my website will cost me more then I will get out of it for a few months, but with the ssl on heroku is just too much.
What would you recommend me?
Edit:
Currently I am looking at openshift which looks kinda interesting. They implemented SSL for free to all users, but I am still not sure if I can use this with my custom domain.
Edit2:
Okay it is only shared ssl. Which means I would have to get "Megashift" which costs $42/month
Edit3:
It seems that I can only deploy war files to GAE, which destroys the purpose of play2.
So I would have to choose between heroku, dotcloud and openshift. And all of them are expensive if you want to use SSL.
I would advice you to give openshift a try
It's free, red hat has stated that it will keep a free offering (it's not just during the beta...)
Here's a screencast:
http://playlatam.wordpress.com/2012/05/21/deploying-play-framework-2-apps-with-java-and-scala-to-openshift/
a github repo
https://github.com/opensas/play2-openshift-quickstart
and an article at red hat
https://openshift.redhat.com/community/blogs/supporting-play-framework-on-openshift-with-the-diy-application-type
I doubt that GAE will work properly with Play. The blacklisting of some classes will impact your project with several limitations that you won't have in another environment, and you have the issue of deploying war files (there are plugins for that in Play 2, but still).
Look at it from another point of view:
if your project is a personal "for fun" project with no other aim than trying something, you probably don't need SSL. Even if you really need (or want) SSL, 20$/month is not so much for a hobby, people pay close to that in games like WoW (subscription + extras) each month.
if your project is serious (startup, aiming to get money) you should stop worrying about expenses like 20$. They are investments to get the cash coming. If as a business you are willing to rewrite your code to save just 20$, you are doomed to fail.
I can recommend you Jelastic.
Besides it offers Jelastic SSL and Custom SSL as well at a reasonable price.
Some hosting Providers allow SSL for free for their customers and the price actually varies depending on the Hosting Provider you choose. So you have alternative here.
Jelastic has recently provided a tutorial on how to deploy Play 2 web framework application to the cloud. So you can freely use it as a basis.