Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I took over support for a PHP app that runs on Heroku. After analyzing the performance with New Relic, I'm noticing that the three bottles necks are the database and API calls to outside services.

With regard to Database: App is constantly calling the database to get list of ingredients and nutritional information for every http request. This is causing a huge bottle neck and previously no caching is implemented.

With regard to API Calls: We make tons of API calls when processing payment. Sometimes the gateways are slow and its another bottle necks.

I have never worked with memchaced, redis, or Heroku worker dynos/IronWorker. What would be the best practice going forward to encapsulate DB and API calls?

Thanks for the input.

share|improve this question

closed as too broad by GlenH7, Kilian Foth, amon, durron597, gnat Mar 25 at 13:26

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs. If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Questions asking about best practices or recommended technologies are too opinion-based for this site. The rest of the question is really difficult to answer since we know too little about your general architecture, or the scale of your site. What and why are you trying to optimize? Response time? With regards to your DB, you do not mention what the precise problem is: new DB connection for each request? Too many queries per request? Too many parallel queries? Latency? There's a lot of context missing in this question, maybe you'd like to edit it. –  amon Mar 17 at 22:09

Browse other questions tagged or ask your own question.