简体   繁体   English

使用Memcached和mysqli(GAE上的php)

[英]Working with Memcached and mysqli (php on GAE)

I am working on scalable solution for my code . 我正在为我的代码开发可伸缩的解决方案。

what i am doing right now is serving ads and keeping the impression and clicks on memcached and via cron pulling the clicks and impression every hour . 我现在正在做的是投放广告,并保持印象和对memcached的点击,并通过cron每小时获取一次点击和印象。

what i am doing right now is saving array on single key (rand key) and

saving the key on key name - 'keys' by append 

than inside the cron i am doing a loop and saving all the keys inside the mysqli. 比在cron中执行循环,并将所有密钥保存在mysqli中。

how can i improve this components ? 我该如何改善这些组件?

Unless you don't care about undercounting, storing data in memcache and expecting it to be there some time later isn't a viable approach. 除非您不担心计数不足,否则将数据存储在内存缓存中并期望一段时间后再出现是不可行的。 Memcache is a shared resource. Memcache是​​共享资源。 Items in GAE memcache have have a highly variable lifetime depending on how other apps are treating memcache. GAE内存缓存中的项目的生存期变化很大,这取决于其他应用程序对待内存缓存的方式。 It's a shared resource, best treated as a short-term, great-if-it's-there cache. 它是一种共享资源,最好将其视为短期的,如果存在的话很好的缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM