Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to utilize 100% of my CPU - Page 2
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to utilize 100% of my CPU

2»

Comments

  • msg7086msg7086 Member

    XMAPP on Windows running a production site managed by a person who has no idea how to optimize the system and asks how to utilize 100% of the CPU.

    What can possibly go wrong? XD

    Thanked by 1vmp32k
  • mkshmksh Member

    @isijosamua said:

    mksh said: How come?

    I think because of this reason.

    yokowasis said: Because there are a lot of software that I used that only run, or run better in windows. Also because my PC is obviously using Windows. I can sync my works using Google Drive and One Drive, which can't be done or very troublesome to do in Linux, because of lack official software.

    I see. I think it's mostly a longwinded way of saying "because i am used to windows" though. His stack is unix software halfarsedly ported to windows and which serious server software only runs or runs better on windows? That leaves finding a convenient way to sync files between his windows desktop and a linux server which can't be all that hard.

    Running windows on a server without a very good reason is pure resource waste and simply a third grade solution asking for unneeded trouble.

    Thanked by 3Silvest maverickp Aidan
  • deankdeank Member, Troll

    And therefore the end is nigh.

    Thanked by 1Aidan
  • jsgjsg Member, Resident Benchmarker

    @yokowasis said:
    to make it clear, my website works fine, if it has less visitor. All function work as it supposed to. But when the traffic (400 users) hit my server, my website load very slow, or timeout. With my dedicated server specs, I believe it can even handle 2000 concurrent user.

    That does NOT mean that you have no network problems. And btw one can have both network problems and software stack problems.

    I tend to not see mysql as the first culprit because if not configured idiotically it has at least some modest caching and shouldn't have major problems with your modest situation. 400 requests per second is not really a heavy load. Plus one can reasonably assume that even a very modestly configured mysql would have the data for at least the home page always in cache.

    My first closer look would be at PHP about whose config you btw told us next to nothing so we are left with mere speculation.

    Another suspicion I have is that your windows system is configured badly, maybe for desktop usage. You seem to have too few handles, processes, etc. But with that I can't help you any further because I know very very little about Windows as I consider it unprofessional and anyway irrelevant in the internet server segment.

    So probably the best advice I can offer to you is to not ask here but rather in some Windows server hobby forum because almost anyone here with a not insignificant level of knowledge about servers is working with some kind of unix I guess.

  • jarjar Patron Provider, Top Host, Veteran

    jsg said: 400 requests per second is not really a heavy load

    You say that until you find out that there's a plugin scraping data on wp-cron to automatically create 600 posts on each run, another plugin making wp-cron run on every page load, and then a theme that decides to be a hero and performs a select * on the posts table instead of using the standard WP method.

    You're laughing right now, but.... I've seen some shit lol

    Thanked by 2iki coreflux
  • raindog308raindog308 Administrator, Veteran

    jarland said: a theme that decides to be a hero

    image

    Perfectly phrased.

    Thanked by 1jar
  • @raindog308 said:

    @uptime said:
    Most likely related to database - this would explain how CPU could be relatively idle while waiting for locks to be released. Without knowing any more details, that would be the first thing I'd take a closer look at. (Also, if I remember correctly a previous thread from some time ago, a more informed approach to database design in general was strongly suggested for this application.)

    Perhaps it is possible. I have changed my database structure based on the suggested in my last thread. My database engine is innodb, doesn't innodb only lock row instead of table ? there are a lot of select query and update query going on. The update query, update different row most of the time. And I believe select query doesn't lock table / row. CMIIW.

    Thanked by 1uptime
  • @mksh said:

    @isijosamua said:

    mksh said: How come?

    I think because of this reason.

    yokowasis said: Because there are a lot of software that I used that only run, or run better in windows. Also because my PC is obviously using Windows. I can sync my works using Google Drive and One Drive, which can't be done or very troublesome to do in Linux, because of lack official software.

    I see. I think it's mostly a longwinded way of saying "because i am used to windows" though. His stack is unix software halfarsedly ported to windows and which serious server software only runs or runs better on windows? That leaves finding a convenient way to sync files between his windows desktop and a linux server which can't be all that hard.

    Running windows on a server without a very good reason is pure resource waste and simply a third grade solution asking for unneeded trouble.

    Believe me. I have tried. REAL TIME 2 Way Sync Onedrive and Google Drive in the Linux is a pain in the ass. If you have any software that can do so, feel free to weigh in.

    Most software just support 1 way sync and not in a real time, a command must be invoked on the remote machine.

    The lack of official software is what makes Linux bad in terms of syncing work OneDrive and Google Drive on Linux.

  • @robohost said:
    Apache max concurent reached?

    Perhaps this is the case. it would explain why apache refuse to serve more visitor, while still have a lot of resource available to use. Will try to explore that possibility.

    Thanks.

  • raindog308raindog308 Administrator, Veteran

    @yokowasis said:
    Believe me. I have tried. REAL TIME 2 Way Sync Onedrive and Google Drive in the Linux is a pain in the ass.

    FYI, REAL TIME 2 Way sync with Dropbox is very easy on Linux.

  • deankdeank Member, Troll
    edited May 2018

    Just stick a fork on him already.

  • Hah.

    Open up your ports and don't patch your server and you'll be sure that people are going to drop miners left and right, thereby using up all your CPU cycles and possibly RAM.

  • @deank said:
    Just stick a fork on him already.

    Forked

  • uptimeuptime Member

    @yokowasis said:

    Perhaps it is possible. I have changed my database structure based on the suggested in my last thread.

    Seemed like quite a few different specific approaches suggested in that thread. Some made more sense than others - perhaps it would be helpful to summarize the ones you followed?

    My database engine is innodb, doesn't innodb only lock row instead of table ? there are a lot of select query and update query going on. The update query, update different row most of the time. And I believe select query doesn't lock table / row. CMIIW.

    Hopefully you'll find better pointers on how to profile MySQL performance - I'd be interested to learn more about this myself. One suggestion from previous thread was to use the "explain" feature in MySQL to provide details about queries.

    From a quick look at https://dev.mysql.com/doc/refman/5.7/en/innodb-locking.html I noticed

    InnoDB supports multiple granularity locking which permits coexistence of row locks and table locks.

    and

    Before a transaction can acquire a shared lock on a row in a table, it must first acquire an IS lock or stronger on the table.

    and

    A lock is granted to a requesting transaction if it is compatible with existing locks, but not if it conflicts with existing locks. A transaction waits until the conflicting existing lock is released. If a lock request conflicts with an existing lock and cannot be granted because it would cause deadlock, an error occurs.

    If any of the above in fact actually applies to your implementation, then this does seem more relevant to updates than queries. (To be clear, this is just an example of something to learn more about - maybe somewhere between a wild guess and a hunch at best.)

    Good luck - please do share more about what you've learned here!

  • @raindog308 said:

    @yokowasis said:
    Believe me. I have tried. REAL TIME 2 Way Sync Onedrive and Google Drive in the Linux is a pain in the ass.

    FYI, REAL TIME 2 Way sync with Dropbox is very easy on Linux.

    Because they have official native client. But I don't use drop box.

  • I have some ideas to try. Will let you guys know on Monday how it works.

    Thanks for all the suggestion and insight.

  • OsatienOsatien Member
    edited May 2018

    Try new relic or another apm and pay for it

  • mkshmksh Member

    @yokowasis said:

    @raindog308 said:

    @yokowasis said:
    Believe me. I have tried. REAL TIME 2 Way Sync Onedrive and Google Drive in the Linux is a pain in the ass.

    FYI, REAL TIME 2 Way sync with Dropbox is very easy on Linux.

    Because they have official native client. But I don't use drop box.

    Seems to be a good reason to start using it as it provides exactly what you are looking for and your current solution fails to archive. Sorry, imo your reply is just another iteration of "i am inflexible and want to stick with what i am used to".

    What @raindog308 suggested is actually a very neat drop in replacement for your current solution. I have little experience with 2 way sync myself at all but a simple web search already revealed unison to be the usual go to solution and unison-ssh as an easy way to get it to play nice on windows but i guess if Dropbox is already a no-go that's hardly worth even mentioning.

    Having said that i don't really see how sshfs and a proper backup system would'nt do the job too. Let alone some versioning system combined with a local development environment. It seems your current setup is aimed at instantly pushing changes to your production server without any chance to even roll back which seems a bit scary.

  • PHP and mySQL on windows are intended for testing and dev purposes.
    In my memory php on windows has limit of 4GB of RAM usage (because of x86 build), not sure if it's solved in php7 or not.
    And mySQL on windows has the same limit of 3.2GB of RAM too.

    Then if you run production on windows server, you will eventually hit a wall.

  • You should only run XAMPP for development.

    Anyways.. Have you configured the Apache MPM settings?

    I believe its the conf/extra/httpd-mpm.conf file. Under the section for mpm_winnt_module you should see the ThreadsPerChild directive.

    https://httpd.apache.org/docs/2.4/platform/windows.html

  • @khuongcomputer said:
    PHP and mySQL on windows are intended for testing and dev purposes.
    In my memory php on windows has limit of 4GB of RAM usage (because of x86 build), not sure if it's solved in php7 or not.
    And mySQL on windows has the same limit of 3.2GB of RAM too.

    Then if you run production on windows server, you will eventually hit a wall.

    That's why you run Win64 binaries. No such limitation there.

    Besides, Azure's Web App services has been running PHP for years in FPM mode for all the shared web workers without too much issues, so the argument that PHP and MySQL on Windows for production is a bad idea is kind of moot.

  • jsgjsg Member, Resident Benchmarker

    @jarland said:

    jsg said: 400 requests per second is not really a heavy load

    You say that until you find out that there's a plugin scraping data on wp-cron to automatically create 600 posts on each run, another plugin making wp-cron run on every page load, and then a theme that decides to be a hero and performs a select * on the posts table instead of using the standard WP method.

    You're laughing right now, but.... I've seen some shit lol

    No, I'm not laughing. I know perfectly well that quite some people out there got stuck in running servers and hosting stuff while they originally were on their way to but failed to find the mental asylum. Maybe a Siri bug.

  • raindog308raindog308 Administrator, Veteran

    TriJetScud said: Besides, Azure's Web App services has been running PHP for years in FPM mode for all the shared web workers without too much issues, so the argument that PHP and MySQL on Windows for production is a bad idea is kind of moot.

    I always wondered how popular that was. Azure does fantastic business with their datacenter extension-type services (e.g., federated Active Directory for redundancy/proximity, etc.) and for their IaaS. But from everyone I talked to, their PaaS services (the original Azure) were kind of a flop because no one wanted to rewrite their apps to work in one vendor's cloud (albeit the very core vendor of the Windows ecosystem).

    And most people who did PHP back then (even today) don't think Windows first.

  • edited May 2018

    TriJetScud said: That's why you run Win64 binaries. No such limitation there.

    Many ready-to-use WAMP stacks only contain 32 bit version for compatible reason.
    Look at the screenshot in the #1 post again, XAMPP complied in 2015, I doubt they're 64 bit version and php newer than 5.4

  • You may be a good candidate for managed hosting. Try knownhost.

    Thanks for recommended us @jarland ! :)

Sign In or Register to comment.