dongxi0523 2016-12-21 11:29
浏览 127

如何在不减慢响应速度的情况下调用微服务?

I want to integrate a new functionality with a Laravel based ecommerce solution. At this point the main scripts takes around 2.7s to run. The whole site loads in above 6s and we've just started to monitor it. The goal is to get below 2s with script and 4s with everything.

The microservice and the functionality is exposed through a gRPC.

There is a TLS based client-server authentication in place (ecommerce instances and my service can prove who they are). This eats few milliseconds.

When testing Go-client and Go-server, with a pool of 20 connections, it achieved below 35ms per requests. In PHP each request takes above 200ms.

Is it possible to:

  1. cache the connection to service between requests?
  2. call RPC methods asynchronously?

Among other solutions I'm considering:

  1. Setting up a local gRPC proxy which will accept only localhost GET requests made by PHP script and make them a secure gRPC calls.
  2. Setting up a proxy in front of PHP application to call microservice.
  3. Calling a service directly from website with JavaScript (puts a burden on a users browser, need to maintain JavaScript).

Any suggestions?

  • 写回答

1条回答 默认 最新

  • duanri1985 2017-01-26 05:10
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭