Is it normal that it takes 3 minutes to restart nodemon due to changes? - nodemon

It takes more than 3 min to restart nodemon. I think it is too long.
I use adonisjs + nuxt (from https://github.com/nuxt/create-nuxt-app).
Under dev mode(I ran "npm run dev"),
I have some server side files that is controllers or models(red area in below attatched image),
and I have also client side files that is Vue page files(yellow area in below attatched image).
When I change any client side files, for example resources/pages/index.vue, nodemon is restarting automatically. And it takes less than 5 sec. It's cool.
But When I change any server side files, for example Controllers/Http/MenuController.js, nodemon is restarting automatically too. But it takes more than 3 min!
I am a newby at nodejs. So I dont know this is normal or abnormal.
I spend more than 3 min every time I change server side code. I think this is too inefficient.
Please let me know how to fix this or why it takes more than 3 min.

Related

WAMP Server not turning green every time I restart my Surface

I've been using WAMP server for a few of my school projects however I have had a lot of trouble with it staying green. I am pretty sure its an internal issue but I'm not really sure how to figure out what exactly is happening. The main problem I experience is that it installs fine and runs. However, whenever I restart my laptop it will not turn green. It stays orange and says 1 of 2 services running. I tried the methods I saw online however it does not even let me right-click it to see what isn't running or to restart the services. I've had to reinstall it about five times to keep using it and it's getting extremely annoying. I think it has to do with mySQL not starting properly but then why do I not get the option to right click?
check if you have any previous installations ( for example : mysql,MariaDB ..ect ) and open task manager and see the proccess of mysql ( open the properties ) if the path isn't from the wamp mysql then desactivate it / kill the process.
here's FAQ Link that helped me alot in the past , you may find it usefull

Calculate how many persons execute my C++ Application

I'm developing C++ Application .I want to know how much time my application is executed . So after the treatement of my application I Add
system("start https://mydomain/stats.php" );
Behind this web page a script that calculate number of visitors . So even user execute my application, after the execution, it will open automatically this web page and increment +1 in number of visitors . But my manager doesn't agree with this solutions and ask me if I can do some thing but in background . Send to server a message to increment number of (persons who executes the application ). So can someone suggests an easy solution(more easier than programming socket ) .My problem seems like doing stat of visiting webpage but in my case It is C++ application not web application .
First of all, do you want to count the times the program is executed or do you want to count the actual persons using it ( or the nuber of installations)
The second thing is quite easy, you could count the times your program is downloaded, directly from the download page. That would probably not even need any changes in your application itself.
For the first one I advise you to ping a certain server or adress and then count the nuber of pings. ( if there is no web connection you could count the times of execution in the program and then ping as many times as needed when there is a connection) Then you would not need to run a web script.

Simple, one-liner solution to chain HTTP->SOCKS5 proxy

We run many parallel scrapers using local TOR proxies. So there's a list of SOCKS5 proxies, around 200 totally:
socks5://localhost:port
socks5://localhost:port2
socks5://localhost:port3
...
Some software does not work with SOCKS and works only with HTTP proxies. So we need to run some software that would act as a HTTP proxy but would redirect the requests to the SOCKS proxy then.
A traditional answer is to use Polipo\Vidalia but they both need to be configured and if you want to run 200 instances you must deal with 200 config files which is not so simple.
Another solution such as MITM proxy (Python) is fine, but it's too slow and eats too much RAM (just multiply every script by 200 - even if one eats 30 megs then it turns into 6 gigs of RAM taken).
Proxychains is ok but it still needs a config file for each instance.
A delegate program was fine but it stopped working for some strange reasons - it refuses to receive connections and returns something like "an intrusion attemt detected, going to stop" - restart does not help. It was run on a local interface, the webservice is ok and not hacked - so that behavior was really strange.
So we're looking for something like delegate but more reliable and without that errors. Something small, fast, preferable written in C\C++.
Or - any software solution in any scripting language (but it should be fast and memory-savvy).
I'm not a C programmer so if you're going to give me some 'examples' of the proxy code in C - it will not work, it will take me a day just to get into the code, compile it and run. Unfortunately =)
Thanks!
Polipo does not need a configuration file — it can read its configuration from the command line. So it's an easy matter to run 200 polipi from a shell script:
for ((i = 0; i < 100; i++)); do
polipo deamonize=true diskCacheRoot='' proxyPort=$((i + 8100)) socksParentProxy=$(host$i) pidFile="/var/run/polipo$i.pid"
done
Note that the above disables the on-disk cache — sharing a single disk cache between many instances of Polipo is not supported — you should ask on the polipo-users mailing list if you need this functionality.
Polipo can be configured to run in just a few megabytes of memory (check the chunkHighMark variable), so running 200 instances should not be an isue.

Why is build time of local application affected by network?

Build time of XPages application containing several JARs, Java sources and ~50 XP/CC elements takes about minute to build on server via WAN. I have replicated application to local, build time dropped to ~10s.
Since few days ago build of local application is extremely slow, about 2-5 minutes. After some experiments there is workaround: to disable TCP port in location document - it drops build times to just few seconds. Even tho it works, it does not help much - testing requires user to be authenticated, so I need to replicate design changes to remote or local server - and that means to change location (online/offline) every time.
UPDATE 2013-04-04: I have duplicated my current location document and removed home and directory servers. To my surprise, with this location build times went back to few seconds - with TCP port enabled so replication is possible. Bigger surprise was the fact, that returning home/directory servers back to new location did not reproduce the problem - in fact they do not affect performance. I know it because I have renamed current location document and everything went to normal. From my understanding, "something" in client configuration was connected to location name. Thanks to Simon's tips I will investigate further.
The question is still open: I am looking for some (eclipse) preference controlling this behavior - unintended communication with server during build of local application.
Solution:
Teamstudio CIAO hooks into designer and checks for every update of design element. Seems to be lack of code optimization to me: it checks whether currently built design element (every single one, one by one) should be controlled in CIAO config database.
This explains why the problem was solved by renaming of location document. I was disappointed yesterday, when performance problems started again. Fortunately, I recalled CIAO setup to that location document about that time. CIAO uses teamstudio.ini file in DATA directory to configure what CIAO configuration database is used for every location document. Look for entry:
CIAOConfigDb[location name]=server name;CIAO\CIAOConfig.nsf
For development on local replicas with connection to server (for replication or local server), use location document with CIAO disabled.
This works only with property ForceConfigLocation=0.
Not a solution (yet!), but may help in the investigation. I'll update further if you post results later.
Debug instructions.
Add the following to the shortcut that launches the Designer client.
-RPARAMS -console -debug -separateSysLogFiles -consoleLog
Start the designer client. This will also open up the OSGi console.
Reproduce the issue. While it is still in progress in the OSGi console type the following:
dump threads
Do this three times, with a small amount of time between completion of each dump. Once done open the three heap dumps (in the IBM_TECHNICAL_SUPPORT folder) in the Heap Dump Analyser.
It will show you what threads are consistent through all three dumps. Take a look at those and look for package names/calls which may appear to be a functional area. Once you have that then you can try adding the debug for the related class.
For example: Let's say you notice "com.ibm.designer.domino.ui.commons." in the thread, then you would edit the rcpinstall.properties file. It will be in:
<Notes Install>\Data\workspace\.config\rcpinstall.properties
and you would add (start with FINE, then FINEST if nothing):
com.ibm.designer.domino.ui.commons.level=FINE
Now when you restart the designer client it will generate debug output in the workspace\logs folder for that package. You need to then go through the trace logs looking for the time when the delay occurred and see if it makes any references to related design elements.
Other open applications may get built at the same time (which looks like a bug top me). Be sure to close all other applications and the server based replica. Open applications have their icon showing in the application list and they stay open even if you close and reopen the Designer. In Designer 9 right click application and select "Close Application". In 8.5 you need to use Package Exprorer for closing.
Another good way is to use Working Sets. Only applications in open Working Set will be built (AFAIK). Have a Working Set with this one app only (and the app only in this Working Set).
update 1
If these don't help I would delete/rename bookmark.nsf, Cache.NDK and desktop8.ndk. Then open just this one app and see what happens.
update 2
Check that there are no referenced projects. Right click the application and select "Project Properties". From there "Project Referencies" and make sure no check boxes are checked.
update 3
Based on your update I would check the item names starting with $ in location document. Sometimes there are saved IP addresses etc. which could cause this problem. All those items can be removed.
If possible (and if You are not using it yet) try to use version 9 of the Domino designer (You do not have to use Domino 9 to do that - it works fine with Domino 8.5.3).
For our projects build times went down to only few seconds from few minutes. I guess that they finally noticed at IBM that the build process used to heavily relay on connection to server and done something with it.
With new designer You don't event have to replicate to local. You can directly work on Your local server.

Auto-Restart a Console Application

I am looking for the console application equivalent of Application.Restart() but cannot seem to find a way to do this.
It has been suggested by others to simply call my Sub Main with Args when I need to restart. However the reason I need the functionality to physically restart the application is because the first thing I do is check for updates and install them if they any are availible.
The update technique itself works perfectly, the system installs new updates but changes do not take effect until next time the application runs obviously.
As the application is run from a batch file as a scheduled task only once a week any updates I release would not take effect for two weeks!
I had the same problem with a windows forms application however the ability to call Application.Restart allows changes to take place imediately. Can the same be achieved when creating a console application?
2 Possibilities i can think of.
First one start another instance of the application and close the current one using something like
System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
and
Environment.Exit(int exitCode)
second if it's not possible to run 2 instances at the same time for some reasons u can create another application that gets started by the batch. Make it run your application and let it get an info if the updating process is done so it can first close the current application and then run another one