0

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

2
  • 2
    You should run a benchmark testing. Commented Jan 31, 2018 at 16:23
  • @TheAlpha simple timing checks? Thanks Commented Feb 2, 2018 at 9:17

1 Answer 1

1

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,
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.