[英]the better method to store page hits in crowded site
I have website with too much traffic, I want to add a hits counter. 我的网站流量太大,我想添加一个点击计数器。 what the better method to store that ?
什么是更好的存储方法? ihave 2 options
我有2个选择
1- create DB and store hits in. 1-创建数据库并存储命中。
2- create local txt file and store hits in. 2-创建本地txt文件并存储命中。
the server is already over loaded so what would be better to avoid more pressure on the server ? 服务器已经过载了,那么最好避免对服务器施加更大的压力?
为避免服务器上的进一步负载,请使用Google Analytics和Statcounter等外部服务。
如果您不想使用外部服务,最好的选择是NoSQL数据库。
替代PHP缓存(APC)将是一种选择。
I would not use a file. 我不会使用文件。
If the server is already under high load it would get even worse if you add that additonal concurrent file (read/write) access 如果服务器已经处于高负载状态,那么如果添加该附加的并发文件(读/写)访问权限则会更糟
I'm confirm with @Antonys answer. 我确认@Antonys的答案。 It will delegate the work for stats to the clients and not to the server.
它会将stats的工作委托给客户端而不是服务器。
这也是你的另一个选择https://www.kissmetrics.com/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.