Although financial terms were not released, the deal is believed to be worth $5.675 million.
After a breakout 2010 campaign that saw him win 15 games, Pelfrey struggled last season, posting a 7-13 mark to go along with a 4.74 earned run average in 34 games (33 starts). He was just 2-5 after the All-Star break while pitching to a 5.00 ERA.
In six seasons, all with the Mets, Pelfrey has a 50-54 record with a 4.40 ERA in 876 2/3 innings over 150 games, 146 starts.
Acosta, 30, made 44 appearances out of the bullpen for the Mets last season, compiling a 4-1 record with four saves and a 3.45 ERA.
Ramirez and Torres were acquired in last month's trade with San Francisco for Angel Pagan.
The 30-year-old Ramirez went 3-3 with a 2.62 ERA in 66 appearances last season with the Giants. Torres, who turns 34 later this month, hit .221 with 24 doubles, one triple, four home runs and 19 RBI in 112 games for the Giants in 2011.