Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Sending large numbers of emails and not getting crashed?

 
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Language : C#
Database : Sqlserver.

I have created a simple migration tool for migrating from one mailbox to another. I have created a database for storing the email data. My code can smoothly send small numbers of emails without a problem..The application hangs whenever I try to send large numbers of emails. What method can I use to prevent this ? I have no idea whatsoever. I am having big performance impact in my application. I know my internet is slow and machine is not powerful enough as well. I have to feed the server baby slowly so it won't choked up. I can think of two solutions, however I have not tried them yet.
1. Sending emails in batches.
2. Using threads to let the application breathe for sometime.

I need your expert advice.

I can think my problem is language independent and Java programmers can also help me in this regard.

best regards,


 
author & internet detective
Posts: 40552
825
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bobby,
When we send out the weekly emails on this site, we do so in batches.

As far as why it hangs, one possibility is that you are using too much memory.
 
Marshal
Posts: 26615
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another possibility is that the server you are using to send the e-mails objects to you is not happy about being used for bulk mailing and is throttling your application. That means it would be delaying each transmission.

That's just another guess. You might consider doing some debugging to see where the slowdown is taking place.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
jQuery Google App Engine Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Jeanne : The Api I am using to send emails have an option of Batch Request , it might come in handy. thanks for the suggestion.

@Paul: Ok Paul. I am using a single thread for sending/receiving emails and for UI, this could be a possible problem. Now , I have some ideas to solve the problem after reading this thread. I will update this thread with a reply as soon as I have an ultimate solution.

thanks.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic