May 4, 2011

High CPU mysql | CyberSEO Pro | Support Forum

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_TopicIcon
High CPU mysql
Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 Topic Rating: 0 (0 votes) 
December 10, 2017
6:50 am
Avatar
cseo67221
Member
Members
Forum Posts: 4
Member Since:
November 14, 2017
sp_UserOfflineSmall Offline

Hello,

Im running Cyberseo for some time now.

I recently changed from shared hosting to VPS 4 cores, 4GB ram and i cant get Cyberseo to run smooth again, it spikes my CPU that eventually it goes down.
What i learned, disable the Cyberseo plugin, CPU goes down to normal values. Change cron from server cron to wp-cron, cpu is at 25 % when running on server cron. When on server cron it way way up and also memory goes way up until the page is down and not responding.

Do you have clue on how to fix or tweak settings? Im running 8 feeds exactly the same as on shared hosting.

Thanks! (centos / Nginx / mariadb / suphp is the current config)

December 10, 2017
12:21 pm
Avatar
cseo67221
Member
Members
Forum Posts: 4
Member Since:
November 14, 2017
sp_UserOfflineSmall Offline

When configuring feeds and how often it needs to check for new posts. Will it schedule this if the cron did not run?

in other words, let say i have 8 feeds check every 5 minutes for new posts and my cron is set to run every 30 min, what happens when the cron actually runs? 30 : 5 = 6 x 8 post = 48 . So when the cron runs will there be 48 processes started?

what will be the best settings to check feeds and how often the cron will run?

December 11, 2017
5:42 am
Avatar
CyberSEO
Admin
Forum Posts: 3706
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

If you are using a server-side cron, the feed will be checked every 30 minutes in this case. As about the best settings, you are the only person who decides. At least I don’t even know how often your feeds are being updated. Do they post a news every 30 minutes?

December 11, 2017
10:35 am
Avatar
cseo67221
Member
Members
Forum Posts: 4
Member Since:
November 14, 2017
sp_UserOfflineSmall Offline

The feeds have news all of the time, it are cam feeds. Mysql is most of the time at 200 – 300% cpu when the plugin is activated.

December 11, 2017
10:55 am
Avatar
CyberSEO
Admin
Forum Posts: 3706
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

And that’s normal. You should understand that your site is not some hand-written WP blog with 20-50 posts. It’s a site with 1000’s of posts that being constantly populated all the time like a conveyor. You have a huge database which takes a lot of resources to be served.

The only thing that I can suggest is to upgrade your server to the latest versions of PHP and MySQL, because PHP 7.2 is about twice times faster than PHP 5.x and the same applies to MySQL 5.7 which is also twice times faster than previous releases.

CyberSEO 7 is fully compatible with the most recent versions of WordPress, PHP and MySQL.

December 13, 2017
12:13 am
Avatar
Erenbur
Member
Members
Forum Posts: 30
Member Since:
May 30, 2017
sp_UserOfflineSmall Offline

Позвольте я вставлю свой вопрос (и предложение). Получается, плагин берет много ресурсов сервера, так как база mysql большая и приходится обрабатывать много запросов? Собственно, мысль. Плагину требуется много ресурсов, чтобы сравнить новую статью с существующими в базе, чтобы не было дубликатов? Из-за того, что статей очень много, поэтому тратится так много ресурсов сервера?

 

Можно добавить функцию в плагин, чтобы он сравнивал, например с последними 100-300 добавленными статьями. Для новостного сайта сравнение со всей базой не нужно, только последние статьи.

December 13, 2017
3:02 am
Avatar
cseo67221
Member
Members
Forum Posts: 4
Member Since:
November 14, 2017
sp_UserOfflineSmall Offline

mm ok, i find it strange i did not had this performance issues on shared hosting so i thought maybe settings are the problem.

December 13, 2017
7:21 am
Avatar
CyberSEO
Admin
Forum Posts: 3706
Member Since:
July 2, 2009
sp_UserOfflineSmall Offline

Erenbur said
Позвольте я вставлю свой вопрос (и предложение). Получается, плагин берет много ресурсов сервера, так как база mysql большая и приходится обрабатывать много запросов? Собственно, мысль. Плагину требуется много ресурсов, чтобы сравнить новую статью с существующими в базе, чтобы не было дубликатов? 

Все операции с базой выполняются только через WordPress API. Соответственно, все эти ресурсы требуются самому WordPress-у, а не плагину CyberSEO.

Что касается проверки статьи на наличие дубликатов, то это происходит так:

Login to see the code

Если сможете как-то оптимизировать, буду рад вам за помощь. Функция сравнения только по последним статьям вызовет кучу проблем, недоумения и ненужных вопросов. Да и MySQL запрос (тот что вы видите выше), не упроститься, а еще более усложниться от этого. Как по вашему MySQL узнает, что это последние посты? По ID нельзя, по дате вообще не вариант. Так что, попробуйте написать его самостоятельно и увидите, что получится.

P.S. Кстати, даже этот запрос выполняется через WordPress API $wpdb->get_var()

December 13, 2017
10:15 am
Avatar
Erenbur
Member
Members
Forum Posts: 30
Member Since:
May 30, 2017
sp_UserOfflineSmall Offline

Рад бы поддержать эту беседу, но я в изучении php дальше < ?php echo “Hello world”; ? > пока не продвинулся :)))

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 541

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ninja321: 84

s.baryshev.aoasp: 64

Freedom: 61

MediFormatica: 49

B8europe: 47

saviulisse67: 45

Member Stats:

Guest Posters: 338

Members: 2666

Moderators: 0

Admins: 1

Forum Stats:

Groups: 1

Forums: 5

Topics: 1547

Posts: 7821

Newest Members:

fairriverllc, josepatricioperalta, goran.o.aroga, betomanzoli, monefff, petergalanko

Administrators: CyberSEO: 3706