aLinks Plugin: memory hog!
Drat! I love the functionality of aLinks. But today, the admin panel of my blog was running so slowly, I had to break down and communicate with Dreamhost about the slowness. After some discussion with them and some fiddling at my blogs, I concluded that aLinks plugin is a hog. (Needless to say, I breathed a sigh of relief to learn the problem was not one of my plugins!)
Evidently, aLinks not a cpu hog (that’s processing) it’s a memory hog. Or at least Dreamhost tells me my problem is memory.
The memory use issue is quite bizarre because the piggish behavior only happens when you are in the admin panel– that is when you write posts, publish, turn plugins on and off etc. It does not happen when the blog loads. (This means my visitors probably noticed nothing.)
When I finally turned off the plugin, my admin panel loaded quickly. The blog always loaded quickly.
I love the functionality of the aLinks. I looked at the calls, and I suspect the program can be salvaged fairly easily by making it do what it does much less frequently. (As in: do whatever it’s doing when the blogger makes changes at aLinks itself or possibly when the blogger publishes a post rather than every time we turn on any random plugin, edit our themes etc. There is no reason aLinks needs to do anything when I make a change to my style sheet! )
Because I love the functionality of the plugin, I’ll be communicating with the plugin developer. Meanwhile, if you are using ALinks, I advise you turn aLinks off. (Sigh. . . I make good money from Amazon using the auto-linking feature of that plugin. )
Tags:aLinks WordPressRelated Posts:
- A Links Plugin
- Two tips to avoid Duplicate Content: Robots.txt or Meta Robots WordPress Plugin
- WordPress Vulnerability: Take a little time to check.
- Lucia's Linky Love for WP 2.3: Option to follow trackback immediately.
Comments
16 Responses to “aLinks Plugin: memory hog!”
Leave a Reply
This is all very strange because I noticed exactly the same thing today, very slow wp-admin, but I’ve used the alinks plugin for some time and it’s never caused a problem before, so what’s up all of a sudden?
I’m going to log back in now and see if things have changed at all, but thanks for bringing it to my attention. I noticed it as soon as I logged in this morning. Strange.
Sorry, feel free to delete this and add it to the one above. Everything seems back to normal now, and I still have alinks running
This can be caused by a number of things but incorrect use of objects is a big killer. Things like sockets be they MySQL or CURL or whatever being left in memory after they are finished with can kill a weak machine. However if you say it makes you plenty of money from amazon then I think this is some code that is going to get my attention. Where can I find it?
@ matt: http://www.alinks.org/
It makes me money on my knitting blog. At that blog, I periodically mention stitch patterns, designers, magazines etc. There are certain ones I really like, so I insert them in aLinks. People do click, then they often buy stuff– strangely enough not what I usually link.
You can also autolink other affiliates.
I used it for years on my knitting blog with absolutely no problem. The problem arose on three blogs all at once.
I actually suspect I know why it happened to me now
First: The memory hogging happens when you are in the admin area only.
I looked at the code. Rignt in the main routine, there is call that creates an object. The call happens only in admin and I experienced slowness only in admin. (FWIW I’m mystified why anything should be created every time I’m in admin. Why should I create an object when I click to change settings on different plugin?)
Second: I’ve been visiting the admin pane at a phenomenal rate because I am fiddling a lot testing my plugins at my blog. I wrote 5 in the past month. And, since adding new settings to Lucia’s Linky Love, I’ve been changing them while checking whether they are working! I’m also turning plugins on and off etc.
Third: Dreamhost has a feature where they somehow automagically slow things down only after you’ve affected the server. So, I experienced the numbing slowness only only after I had done enough of this fiddling to affect the server. Somehow, whatever they use to limit speed kicks in when it sees the guilty party rearing it’s head. So, that makes it sort of obvious where the problem is once you switch off the guilty plugin!
Still, I think aLinks at least needs to be fixed to not create the memory intensive object quite so often.
Great thoughts. I never realized how my performance varied such a drastic amount when I started aLinks, until I read your blog.
I’ve not installed word press so don’t bank on my being right after jsut reading the code but it looks like it is trying to phone home. It _should_ only try this once every five days but what you have mentioned it sounds like it is failing to store some date in a meaningfull way. It’s calling what looks like a wordpress function update_option where it should store te datetime stamp of th last attempt. If it was me I would comment out line 74 of alinks.php and se if it starts behaving itself.
The line in question says
$alinksNotices = new aLinksNotices(ALINKS_VERSION);
It looks like a nice plugin so I might port it to NucleusCMS if I get a moment to try the new version which was released yesterday.
I’ve just reread the comments of “Maurice (TheCaymanHost)” and I’d now give you even money on my guessing being right.
After reading the documentation for your platforms XML RPC I don’t thing that line 74 (what is it with that number?) of aLinksNotices.php is correct as the object may not return a Boolean.
Furthermore it will keep trying to phone home until it succeeds meaning while in admin area it will fire off an XML RPC request every page load because each one fails it never increments the timer.
I’ll bet you that if you change line 79-81 from
if (empty($currentVersion)) {
return false;
}
to
if (empty($currentVersion)) {
$this->addVersionOptions();
return false;
}
then it will stop messing you about.
I’m guessing that the real problem (other than a lack of a try again later function) is the server is not coping the authors end or you host has closed the ports your XML-RPC wanted to use.
You can probably guess that I am getting ready to port the code starting by reading it all.
@Matt, if you read it, that would be great. I use it to: autolink various affiliates and autolink blogs I mention often. It’s very handy. (Plus, should friends every change blogs, I can redirect all the links to the new address! )
I’ll be trying to fix this when I can. Hubby is due home soon though, so I’m going to go fix dinner. (Then, I’m going to try to get him to go to dance practice!)
@Matt,
Further evidence your theory is correct: I am having “issues” with trackbacks and pinging. Andy noticed that I ping wildly and repeatedly. I noticed no one else’s pings arrive.
So, it is quite possible the server has done something with that. Fixing trackbacks and pings is on my “to do” list.
OK and Cool. glad I could throw some clues your way sadly it is midnight here and coffee or no it is bed time.
@Matt
Porting this would be brilliant and it sure would be nice to use it within NucleusCMS.
@Lucia
I’ll be keeping an eye on this to see what happens with the WP plugin too.
@all,
I posted a fix on http://headzoo.com/alinks (in the comments). As others have pointed out, it was a problem with aLinks trying to phone home, but home not responding.
I moved headzoo.com to a new server a week or so ago, but I forgot about the XMLRPC code that aLinks is trying to communicate with. I’ll be putting that back in place tonight.
The plugin does phone home every week to check if there is a newer version available. And if so, then it notifies you.
Thanks Sean! Sorry I overlooked emailing you directly. Dreamhost also mentions the fix for the problem which is a primarily a big in PHP! (Still, everyone has to work around it, don’t they?)
The PHP bug also affects people’s abilit to trackback.
I’ll update to tell people the new plugin is available. It’s GREAT!
Confirmed - Alinks began slowing down my admin panel BUT I have something to add to the discussion.
I don’t think anything has changed, Alinks has run well on my blog for months and I didn’t change anything before the admin slowdowns happened. What is happening also isn’t a slowness to load, it’s a complete pause followed by an instant load… something is putting on the brakes - my host.
My host hates alinks and is slapping me with a pause of up to 30 seconds on every admin pageload when alinks is turned on.
Wikipedia uses a similar setup - can you imagine what would happen if all wikipedia links vanished? lol
Hope you get this sorted out soon developers… Alinks is one of the BEST plugins for helping visitors (and making money) available.
Hrrrm - looks like headzoo has gone down… the alinks dev site.
Anyone know where the updated plug in can be found since headzoo is still down?