(Reuters) - Akamai Technologies Inc's AKAM.O profit and revenue topped analysts' estimates on Tuesday, and the company said it had cut about 400 positions, or 5 percent of its global workforce.

The company’s shares were up 8.2 percent at $68.87 in extended trading.

Activist investor Elliott Management, which has disclosed a 6.5 percent stake, would push Akamai to curtail what the hedge fund sees as wasteful spending, among other measures, sources told Reuters in December.

“As part of our effort to improve operational efficiency, we reduced headcounts in targeted areas of business, most notably in areas tied to our media business,” Chief Executive Tom Leighton said on a post-earnings call with analysts.

Akamai's media business, which helps in faster delivery of content through the web, has been under pressure from large customers, such as Apple Inc AAPL.O and Amazon.com AMZN.O, developing in-house capabilities to handle their web traffic.

Revenue in the unit declined 3 percent to $284 million in the fourth quarter ended Dec. 31, the ninth straight quarterly drop.

To offset the weakness, the company is bolstering its cloud security solutions.

Revenue in the company’s cloud unit surged over 32 percent to $135.2 million. Quarterly sales growth in the unit has averaged about 30 percent in 2017.

The company, which recorded a $52 million charge related to the restructuring in the fourth quarter, said it would take another charge of about $15 million in the current quarter.

Total revenue rose 7.7 percent to $663.5 million, beating analysts’ average estimate of $649.1 million, according to Thomson Reuters I/B/E/S.

The company’s net income plunged to $19.1 million, or 11 cents per share, from $91.6 million, or 52 cents per share, a year earlier, due to the charges.

Akamai also recorded a $26 million provisional charge associated with the recent U.S. tax law changes.

Excluding items, the company earned 69 cents per share, 6 cents above analysts’ average estimate.

The company forecast first-quarter revenue in the range of $647 million to $659 million, above analysts’ average estimate of $647.61 million.

Profit is expected to be about 67 cents to 70 cents per share, compared with expectations of 61 cents.