douxi7219 2018-01-31 16:20
浏览 35

通过使用Javascript(Ajax)到PHP(登录到mysql)传递大量的小请求

would it be the right way to solve such problem?

Problem:

there will be amount of requests (200-400 per second) coming from users browsers through Javascript (Ajax) to my PHP node (single .php file), which will be logging some information to mysql database (e.g. user-agent, screen size, other user's public data). The amounts of single request sent information will be small (1-2kb).

What can you advice to prevent my server (or database) (1Core 2.5Ghz 1 GB RAM from dying from such amount of requests?

Or i should not worry about such amounts of requests at all?

Thanks

  • 写回答

1条回答 默认 最新

  • drd94483 2018-01-31 16:55
    关注

    You can use DVM's to see whats taking up the most worker time. If you're on linux I'd also recommend watching \ checking your htop report to see how much strain is being put on your core in real time. Here's a good DVM to use if to see what's taking up your worker time. Unless you're doing something inefficient query wise you shouldn't have any issues though, but the only way to know for sure is benchmarking.

    SELECT TOP 10 SUBSTRING(qt.TEXT, (qs.statement_start_offset/2)+1,
    ((CASE qs.statement_end_offset
    WHEN -1 THEN DATALENGTH(qt.TEXT)
    ELSE qs.statement_end_offset
    END - qs.statement_start_offset)/2)+1),
    qs.execution_count,
    qs.total_logical_reads, qs.last_logical_reads,
    qs.total_logical_writes, qs.last_logical_writes,
    qs.total_worker_time,
    qs.last_worker_time,
    qs.total_elapsed_time/1000000 total_elapsed_time_in_S,
    
    评论

报告相同问题?

悬赏问题

  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c